I am trying to install and run react-native app on an android emulator in my windows device but i keep getting this error
FAILURE: Build completed with 2 failures.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform react-android-0.71.4-debug.aar (com.facebook.react:react-android:0.71.4) 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}. > Could not download react-android-0.71.4-debug.aar (com.facebook.react:react-android:0.71.4) > Could not get resource 'https://repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > Could not GET 'https://repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (repo.maven.apache.org)
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. ==============================================================================
What went wrong: java.lang.StackOverflowError (no error message)
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. ==============================================================================
BUILD FAILED in 2m 50s
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 completed with 2 failures.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform react-android-0.71.4-debug.aar (com.facebook.react:react-android:0.71.4) 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}. > Could not download react-android-0.71.4-debug.aar (com.facebook.react:react-android:0.71.4) > Could not get resource 'https://repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > Could not GET 'https://repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (repo.maven.apache.org)
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. ==============================================================================
What went wrong: java.lang.StackOverflowError (no error message)
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. ==============================================================================
BUILD FAILED in 2m 50s
at makeError (C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\execa\index.js:174:9)
at C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.
Based on your questions you can do 3 things here:
./gradlew cleanBuildCache
./gradlew wrapper --gradle-version 8.0.2
org.gradle.jvmargs=-Xss512m
This will increase the stack size to 512MB.
Let me know if it works now. I also would make sure your internet connection is stable.
Having a similar issue. What I noticed, in the node_modules/react-native/android/ there is no aar and just a readme file saying this:
Starting from React Native 0.71, we're not shipping the
/androidfolder inside the React Native NPM package anymore due to sizing constraints on NPM. The Android artifacts are distributed via Maven Central. You can read more about it in this RFC: https://github.com/react-native-community/discussions-and-proposals/pull/508If you're a library author and you're manipulating the React Native .aar files, to extract headers, extract
.sofiles or do anything with it, you're probably doing something wrong. React Native 0.71 ships with all the necessary logic to let you consume it transparently by just using:implementation("com.facebook.react:react-android") // or to keep backward compatibility with older versions of React Native: implementation("com.facebook.react:react-native:+")You should consider refactoring your library code not to unzip/manipulate the React Native .aar files.
This README.md file is kept in this folder as some libraries are checking the existence of the /android folder and failing user builds if the folder is missing.
So I would try to add the implementation dependency and remove the task
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With