I have been getting this error when trying to run npm android build on my native react project. I have gone through the entire android setup along with updating Environment variables. The emulator works but the install fails with the following message:
What went wrong:
Execution failed for task :app:checkDebugAarMetadata .
> Could not resolve all files for configuration :app:debugRuntimeClasspath .
> Failed to transform react-android-0.72.6-debug.aar (com.facebook.react:react-android:0.72.6) 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-runtimeiii.
> Execution failed for JetifyTransform: C:UsersBenTo.gradlecachesmodules-2files-2.1com.facebook.react
eact-android .72.62e2db118c9084b05c1a5d6079148bc983668f372
eact-android-0.72.6-debug.aar.
build.gradle as follows:
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
iii
repositories {
google()
mavenCentral()
iii
dependencies {
classpath("com.android.tools.build:gradle")
classpath( com.facebook.react:react-native-gradle-plugin )
iii
iii
我也开了反应医生,显示:
Android
✓ Adb - Required to verify if the android device is attached correctly
✓ JDK - Required to compile Java code
✓ Android Studio - Required for building and installing your app on Android
✖ Android SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: 33.0.0
✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
Errors: 1
Warnings: 0
Usage
› Press f to try to fix issues.
› Press e to try to fix errors.
› Press w to try to fix warnings.
› Press Enter to exit.
当我要求解决时,它表明这些问题是固定的并重新开始。 当我重新开会时,我也遇到同样的错误。
请提供帮助。