React native error, Execution failed for task ':app:processDebugResources' - react-native

Any ideas what this error means?
When I try and run, npm run playground-android, I get the error.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
java.io.IOException: Could not delete path 'C:\sites\ReactMatt\lower-your-drinking\android\app\build\generated\source\r\debug\org\webkit'.
Any ideas?

I one had similar issues. Below is how I fixed it.
cd android //Navigate into the android folder from the root directory
./gradlew clean // Run this
I hope it helps

On windows
i resolved by
1. cd android
2. ./gradlew clean

Try to close Android Studio while building through the CLI

I had this same problem but gradlew clean did not resolve issue until I removed the android and ios folders from my project and then used these commands;
react-native eject
react-native link
react-native run-android
good luck.

This works for me!
1) Navigate to android : cd android
2) Then run this command: ./gradlew clean

In your project,
Navigate to android => cd android
Then, run this command => ./gradlew clean
Then, open your project's Android kloser from Android Studio and Build Gradle

Related

Task :react-native-location:compileDebugJavaWithJavac FAILED while building apk

I'm trying to build my apk & I'm getting this error while building my release apk in react native. Is there any way to fix this react-native-location error?
I was facing this issue while building my apk in react native. To solve this issue you need to:
1- cd android and then ./gradlew clean
2- then in your root directory run yarn jetify or npx jetify

RN Error :> Task :app:generateDebugBuildConfig FAILED

I have a problem building a RN project in android I run: yarn android and that's what I face:
I tried to clean the gradle: ./gradlew clean I also tried to delete the build in android: rm -rf android/app/build but none of these worked for me.
Any clue what's the problem or maybe solution?
try to open android folder on your project in android studio app, gradle will update automatically

Gradlew bundleRelease doesnt generate release apk in react-native

I try to get apk of app. I did it before well. However, I tried to use get apk of other app today but it doesnt give me release apk. why ?
I followed these steps : enter link description here
Normally, it takes 2-3 minutes but now it lasts just 3 sec and doesnt generate apk
it says this :
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 6.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
I had the same problem. Following command worked for me:
After the ./gradlew bundleRelease command we get a .aab version of our app. To get APK, you should run the app with release version on any device with the below command.
Make sure you have connected an android device
For the production ready app, firstly you have to remove the previous app from the device
Run this command in your-project/:
react-native run-android --variant=release
Then APK can be found in android/app/build/outputs/apk/release
Hope this helps
the short answer uses gradlew assembleRelease instead.
not short answer :) The command you are using gradlew bundleRelease builds an android App bundle. read this:
Difference between apk (.apk) and app bundle (.aab)
and this:
https://developer.android.com/guide/app-bundle
AAB file is new and not all stores support it.
Use gradlew bundleRelease to generate an app bundle (.aab file) and gradlew assembleRelease to generate an apk (.apk file). To install a release on your emulator, use react-native run-android --variant=release. I hope this helps
Cutting the long story short the command gradlew bundleRelease is used to generate an .aab file where as the command gradlew assembleRelease is used to generate .apk file so use the command accordingly
I made a file that called build.sh.
When i want to release a new version of android in ReactNative, just type and press sh ./build.sh in terminal.
My shell script in build.sh file:
npx jetify && cd android && ./gradlew clean && ./gradlew assembleRelease && ./gradlew bundleRelease && cd ..
You can simply open the Build Variants window on the bottom left hand corner of Android Studio and choose release as the current variant:
The following should solve your issue:
Open Android Studio and select "build bundle(s)" from Build/Build Bundle(s)/Apk(s)
Then, open your console and run
cd android && ./gradlew bundleRelease
from your project's root. You may encounter an error such as
Cannot add task 'wrapper' as a task with that name already exists., because overriding built-in tasks are deprecated in 4.8 and produces an error.
To prevent it, please update your android/build.gradle, as follows:
FROM:
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
TO:
wrapper {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
Lastly, don't forget to convert your .aab file to .apk through bundletool in order to test locally your app (exactly as an APK file)
step - 1) ./gradlew bundleRelease
step - 2) react-native run-android --variant=release
Make sure you have connected an android device
For the production-ready app, firstly you have to remove the previous app from the device
./gradlew app:bundleRelease Will fix your problem for sure.

React-native -run-ios error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65

good time.
run ios error Failed
run code
react-native run-ios
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactapp.xcodeproj
** BUILD FAILED **
I've got the same error when run
$ react-native run-ios
My workaround steps:
open project by Xcode and choose the signature information as the attached image.
clear build folder: 'Your Project'/ios/build
re-run:
$ react-native run-ios
Hope this help.
That's because there is a new version of Flipper and React Native might not come with the right one so best is to go in your podfile and add this use_flipper!({ 'Flipper' => '0.74.0' }) then run pod install
If you don't have cocoa pods installed you need to by command sudo gem install cocoapods and run following commands from your project main directory
cd ios
pod install
cd ..
delete build folder from ios
react-native run-ios
if error persists, 1. delete build folder again 2. open the /ios folder in x-code 3. navigate File -> Project Settings -> Build System -> change (Shared workspace settings and Per-User workspace settings): Build System -> Legacy Build System
cd ios
rm -rf build/
cd ..
react-native run-ios

Execution failed for task ':app:compileDebugJavaWithJavac' in Window Setup for react-native run-android

enter image description here
Not able to get pass this error. Checked my JAVA_HOME path and ANDROID_HOME path. Still not able to figure it out. I checked other solutions but of no help till now.
Try a gradle clean using the following commands
cd android
.\gradlew clean
cd ..
react-native run-android