[Whenever I enter the command npx react-native run-android, I get the following: Task :app:checkDebugAarMetadata FAILED Build failed
I have never gotten my app to build and run successfully on my emulator
I am using gradle 7.1.1 and the JDK 16 This is what I have under dependencies in build.gradle ...classpath("com.android.tools.build:gradle:4.1.0") Everything is set in my environment as guided by react native documents.
Firstly, I got this error message Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0 but I solved it by replacing jcenter for maven in the build.gradle file.
Now I have these errors to fix:
***> Task :app:checkDebugAarMetadata FAILED 4 actionable tasks: 2 executed, 2 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'. Could not find com.facebook.fresco:fresco:2.2.0. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/facebook/fresco/fresco/2.2.0/fresco-2.2.0.pom - file:/C:/Users/earle/.m2/repository/com/facebook/fresco/fresco/2.2.0/fresco-2.2.0.pom - file:/C:/Users/earle/React Native Programming/rncontacts/node_modules/react-native/android/com/facebook/fresco/fresco/2.2.0/fresco-2.2.0.pom - file:/C:/Users/earle/React Native Programming/rncontacts/node_modules/jsc-android/dist/com/facebook/fresco/fresco/2.2.0/fresco-2.2.0.pom - https://repo.maven.apache.org/maven2/com/facebook/fresco/fresco/2.2.0/fresco-2.2.0.pom - https://www.jitpack.io/com/facebook/fresco/fresco/2.2.0/fresco-2.2.0.pom Required by: project :app > com.facebook.flipper:flipper-fresco-plugin:0.75.1 project :app > com.facebook.flipper:flipper-fresco-plugin:0.75.1 > com.facebook.fresco:flipper:2.2.0***
Error messages in screenshot link below
I have googled as best as I could but no luck.
Some of the solutions that I've tried were:
- Turned off proxy
- changed compileSdkVersion and targetSdkVersion from 29 to 30
- I relocated the google method to the top in the build.gradle file
- cd android && .\gradlew clean | .\gradlew assemble
- I deleted node modules and reinstalled
- I replaced jcenter for maven (needed as I'm using the latest gradle)
- I ran npx @react-native-community/cli doctor and I have green ticks (SDK, JAVA_HOME and more)
- I had react-native-cli and uninstalled. It made no difference
- Tested the app in both VS Code and Android Studio and it was the same result
I don't know what else to do
Here is what I got from react-native info
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
Memory: 393.50 MB / 7.78 GB
Binaries:
Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29, 30
Build Tools: 29.0.2, 29.0.3, 31.0.0
System Images: android-28 | Google APIs Intel x86 Atom_64, android-29 | Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 4.2.0.0 AI-202.7660.26.42.7351085
Visual Studio: Not Found
Languages:
Java: 16.0.1 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found