0

The app build failed just after I have installed react-native-maps, the error message is like

Task :react-native-maps:processDebugManifest
package="com.rnmaps.maps" found in source AndroidManifest.xml: C:\Users\Dell\ow\node_modules\react-native-maps\android\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported, and the value is ignored. Recommendation: remove package="com.rnmaps.maps" from the source AndroidManifest.xml: C:\Users\Dell\ow\node_modules\react-native-maps\android\src\main\AndroidManifest.xml.

Task :react-native-maps:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
52 actionable tasks: 12 executed, 40 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-maps:compileDebugJavaWithJavac'.

Could not resolve all files for configuration ':react-native-maps:androidJdkImage'. Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: C:\Users\Dell\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar. > Error while executing process C:\Program Files\Java\jdk-21\bin\jlink.exe with arguments {--module-path C:\Users\Dell.gradle\caches\transforms-3\393400499b2af28f59d755a5f301569b\transformed\output\temp\jmod --add-modules java.base --output C:\Users\Dell.gradle\caches\transforms-3\393400499b2af28f59d755a5f301569b\transformed\output\jdkImage --disable-plugin system-modules}

  • 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 54s error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-maps:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':react-native-maps:androidJdkImage'. > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: C:\Users\Dell\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar. > Error while executing process C:\Program Files\Java\jdk-21\bin\jlink.exe with arguments {--module-path C:\Users\Dell.gradle\caches\transforms-3\393400499b2af28f59d755a5f301569b\transformed\output\temp\jmod --add-modules java.base --output C:\Users\Dell.gradle\caches\transforms-3\393400499b2af28f59d755a5f301569b\transformed\output\jdkImage --disable-plugin system-modules} * 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 54s. info Run CLI with --verbose flag for more details.

The app build failed just after I have installed react-native-maps, i have the latest jdk-21, set the path of JAVA_HOME in environment variables. The app has a home screen and a details screen to navigate, on the details page i am trying to implement maps and even before writing any code with maps the build fails which was successful just before the install of react-native-maps. I have fetched google maps api too and set to go, but this error keeps happening. i tried to uninstall the react-native-maps and then build again, then it's successful, so it's puzzling a bit.

1 Answer 1

1

I think issue is with your Gradle Version which is not compatible. Kindly update classpath and compile sdk version as:

buildscript {
ext {
    buildToolsVersion = "34.0.0"
    minSdkVersion = 21
    compileSdkVersion = 34
    targetSdkVersion = 34
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:8.6.0'
}
}

or update gradlew version through terminal,

cd android ./gradlew wrapper --gradle-version=8.6.0

after that run ./gradlew clean

also install latest version of maps

npm install react-native-maps@latest

then run build, if problem still persist kindly share your react-native version and gradlew version also maps version. Happy Coding!

Sign up to request clarification or add additional context in comments.

10 Comments

tried to upgrade gradle and installed the maps again, there's a different error now like error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Could not open settings generic class cache for settings file 'C:\Users\Dell\ow\android\settings.gradle' (C:\Users\Dell\.gradle\caches\7.3.1\scripts\5ozjdedslfmogg43ejvzms3ux). > BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65
react-native ersion is 0.73 & gradle version is 7.3.1
what is your java version? check it using java --version
it's java 21.0.2 2024-01-16 LTS Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
either use jdk version 17 which is compatible with gradlew you are using like: brew install openjdk@17 then set it default jdk like this: sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk echo 'export PATH="/usr/local/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc export CPPFLAGS="-I/usr/local/opt/openjdk@17/include" it may vary based on your machine , i'm using mac book pro and zsh finally source ~/.zshrc and check jdk version set default is 17 and rerun application by clearing gradlew or update gradle to 8.6
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.