0

I am facing this Error while running my react native project on android at windows. Here are details of the error in the CLI

Task :app:checkDebugAarMetadata FAILED 19 actionable tasks: 2 executed, 17 up-to-date

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. Execution failed for JetifyTransform: C:\Users\hayat.gradle\caches\modules-2\files-2.1\com.facebook.react\react-native\0.71.0-rc.0\7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543\react-native-0.71.0-rc.0-debug.aar.
Java heap space

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 30s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

I have tried two solutions One upgrading SDK version

  buildToolsVersion = "30.0.3"  
  minSdkVersion = 29  
  compileSdkVersion = 31  
  targetSdkVersion = 31  
  supportLibVersion = "29.0.0"

And second by adding this code in build.gradle file

android {
    defaultConfig {
        configurations.all {
            resolutionStrategy { force 'androidx.work:work-runtime:2.6.0' }
        }
    }
}
farooq
  • 31
  • 2
  • 7
  • 1
    Does this answer your question? [React Native Android build failure with different errors without any changes in code for past days due to publish of React Native version 0.71.0-rc.0](https://stackoverflow.com/questions/74334162/react-native-android-build-failure-with-different-errors-without-any-changes-in) – Thanhal P A Nov 16 '22 at 07:21
  • my project started working without applying this solution. my problem was something else. But this one is very useful answer. Thanks – farooq Nov 16 '22 at 18:38

0 Answers0