react native FAILURE: Build failed with an exception gradle problem - reactjs

Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'AwesomeProject'.
Could not determine the dependencies of null.
Could not resolve all task dependencies for configuration ':classpath'.
> Could not resolve jakarta.xml.bind:jakarta.xml.bind-api:2.3.2.
Required by:
project : > com.android.tools.build:gradle:7.3.1 > org.glassfish.jaxb:jaxb-runtime:2.3.2
project : > com.android.tools.build:gradle:7.3.1 > org.glassfish.jaxb:jaxb-runtime:2.3.2
Get more help at https://help.gradle.org
BUILD FAILED in 31s
please help how to solve this problem
i tried updating gradle but it didn't worked

Related

How to resolve the error message: react-native-push-notification:extractReleaseAnnotations FAILED

I have been struggling with this error.
When I run yarn android the build is successful, however when I run ./gradlew assembleRelease I continue to receive this error.
> Task :react-native-push-notification:extractReleaseAnnotations FAILED
w: Detected multiple Kotlin daemon sessions at build\kotlin\sessions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-push-notification:extractReleaseAnnotations'.
> Could not resolve all files for configuration ':react-native-push-notification:lintClassPath'.
> Could not download intellij-core-30.0.4.jar (com.android.tools.external.com-intellij:intellij-core:30.0.4)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.0.4/intellij-core-30.0.4.jar'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.0.4/intellij-core-30.0.4.jar'.
> dl.google.com
> Could not download kotlin-compiler-30.0.4.jar (com.android.tools.external.com-intellij:kotlin-compiler:30.0.4)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/30.0.4/kotlin-compiler-30.0.4.jar'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/30.0.4/kotlin-compiler-30.0.4.jar'.
> No such host is known (dl.google.com)
Any help to get this fixed is appreciated.
I was able to resolve the issue by simply path-to-project\android\build.gradle
allprojects {
repositories {
google() //<-- Moving this above maven
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
Hope this helps someone.

Could not resolve all artifacts for configuration ':payu-non-seam-less-react:releaseRuntimeClasspath'

I was using the PayU payment gateway since last year in a project and it was working fine but when I'm using that project now then i getting error:-
> Could not resolve all artifacts for configuration ':payu-non-seam-less-react:releaseRuntimeClasspath'.
> Could not resolve in.payu:payu-crash-logger:[1.0.4,1.1.0).
Required by:
project :payu-non-seam-less-react > in.payu:payu-checkout-pro:1.8.9
project :payu-non-seam-less-react > in.payu:payu-checkout-pro:1.8.9 > in.payu:payu-sdk:5.4.7
> Failed to list versions for in.payu:payu-crash-logger.
> Unable to load Maven meta-data from https://phonepe.bintray.com/PhonePeIntentSDK/in/payu/payu-crash-logger/maven-metadata.xml.
> Could not get resource 'https://phonepe.bintray.com/PhonePeIntentSDK/in/payu/payu-crash-logger/maven-metadata.xml'.
> Could not GET 'https://phonepe.bintray.com/PhonePeIntentSDK/in/payu/payu-crash-logger/maven-metadata.xml'. Received
status code 502 from server: Bad Gateway
finally, I resolve this problem
first i uninstall payu-non-seam-less-react (means old version)
then install the latest version.
but then I stuck with new errors then I clear the build(./gradlew clean)
and then I added below code in android/gradle.properties
org.gradle.jvmargs=-Xmx4608m
then run this project.

Suddenly facing this issue. Previously it was working fine

BUILD FAILED in 2s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'Peace Garden'.
Could not determine the dependencies of null.
Could not resolve all task dependencies for configuration ':classpath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :
> No matching variant of com.facebook.react:react-native:0.71.0-rc.0 was found. The consumer was configured
to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally,
as well as attribute 'org.gradle.plugin.api-version' with value '7.3.3'

Azure DevOps ionic Error building android

While running Azure DevOps tasks for cordova to build android getting following error, but the same code build fine in local machine!
[ERROR] An error occurred while running subprocess cordova.
cordova platform add android#8.0.0 --verbose exited with exit code 1.
Even including --verbose doesnt give any more insights into whats went wrong! Any clues on resolving this?
Log :
2020-06-10T12:07:08.9595670Z Updating icons at platforms/android/app/src/main/res
2020-06-10T12:07:08.9595970Z Updating splash screens at platforms/android/app/src/main/res
2020-06-10T12:07:08.9596290Z This app does not have additional resource files defined
2020-06-10T12:07:08.9596560Z Prepared android project successfully
2020-06-10T12:07:08.9597390Z Executing script found in plugin cordova-plugin-add-swift-support for hook "after_prepare": plugins/cordova-plugin-add-swift-support/add-swift-support.js
2020-06-10T12:07:08.9597890Z Resolving module name for glob => glob
2020-06-10T12:07:08.9598130Z Saving android#8.0.0 into platforms.json
2020-06-10T12:07:08.9598640Z --save flag or autosave detected
2020-06-10T12:07:08.9598910Z Saving android#~8.0.0 into config.xml file ...
2020-06-10T12:07:08.9599200Z adding android to cordova.platforms array in package.json
2020-06-10T12:07:08.9599480Z No scripts found for hook "after_platform_add".
2020-06-10T12:07:08.9599780Z [ERROR] An error occurred while running subprocess cordova.
2020-06-10T12:07:08.9600000Z
2020-06-10T12:07:08.9600570Z cordova platform add android#8.0.0 --verbose exited with exit code 1.
2020-06-10T12:07:08.9600850Z
2020-06-10T12:07:08.9601610Z Re-running this command with the --verbose flag may provide more information.
2020-06-10T12:07:08.9602390Z 2020-06-10T12:07:08.134Z ionic:utils-process onBeforeExit handler: 'process.exit' received
2020-06-10T12:07:08.9603200Z 2020-06-10T12:07:08.134Z ionic:utils-process onBeforeExit handler: running 1 functions
2020-06-10T12:07:08.9603970Z 2020-06-10T12:07:08.162Z ionic:utils-process processExit: exiting (exit code: 1)
2020-06-10T12:07:08.9604510Z [0m]

processDebugResources FAILED after changing icon launcher

I change launcher icon in this address:
Projects\nameproject\android\app\src\main\res
And then linked them by this command:
npx react-native link
after re-building project by this command:
react-native run-android
I am getting following error:
> Task :app:processDebugResources FAILED
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.5/userguide/command_line_interface.html#sec:comman
d_line_warnings
108 actionable tasks: 5 executed, 103 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
C:\Users\TORANJ\Desktop\Projects\insta\android\app\build\intermediates\merged_
manifests\debug\AndroidManifest.xml:16: AAPT: error: resource mipmap/ic_launcher
_round (aka com.insta:mipmap/ic_launcher_round) not found.
error: failed processing manifest.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 25s
error Failed to install the app. Make sure you have the Android development envi
ronment set up: https://facebook.github.io/react-native/docs/getting-started.htm
l#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8
081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
C:\Users\TORANJ\Desktop\Projects\insta\android\app\build\intermediates\merged_
manifests\debug\AndroidManifest.xml:16: AAPT: error: resource mipmap/ic_launcher
_round (aka com.insta:mipmap/ic_launcher_round) not found.
error: failed processing manifest.
I ran gradlew clean but issue is persisting:
Does anybody have any idea how can i fix this?
I faced this same issue. It is because react-native android app icons run in round shaped. It shows build/ processDebugResources failed because we didn't add circle shaped app icon in res folder.
First, after creating a fresh project, look in the android/app/src/main/res folder, you will find ic_launcher & ic_launcher_round, right?
So, I suggest you to go Launcher icon generator to make two shaped icons (circle and square), paste them in icon folders with same name(ic_launcher & ic_launcher_round) and build the project.
You will find that app icon is updated.
I just copy ic_launcher and past it to same folder as ic_launcher_round. for example in mipmap-hdpi folder i just have an ic_launcher file and I manually copy and paste this, then run cd android && ./gradlew clean and run npx react-native link in root folder again, then rebuild the project again with npx react-native run-android command.

Resources