[HAS WORKAROUND] Android build fails for AAR metadata (app:checkDebugAarMetadata)
WORKAROUND
Issue #35210 now has the best description and current best-known fix for the issue
we are working hard to keep that issue up to date as we learn new things
go to the issue and get the workaround: #35210
Description
Builds started failing couple hours ago.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.appcompat:appcompat:1.4.1.
AAR metadata file: /Users/ajithab/.gradle/caches/transforms-3/39f92ca209255d032ca0f63ea8bb1f5a/transformed/appcompat-1.4.1/META-INF/com/android/build/gradle/aar-metadata.properties.
Version
0.67.2
Output of npx react-native info
System: OS: macOS 13.0 CPU: (8) arm64 Apple M1 Memory: 78.53 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.18.1 - /opt/homebrew/opt/node@16/bin/node Yarn: 1.22.19 - ~/develop/2dpoint-mobile-app/node_modules/.bin/yarn npm: 8.19.2 - /opt/homebrew/opt/node@16/bin/npm Watchman: 2022.10.31.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 11.0.17 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
yarn run android
Snack, code example, screenshot, or link to a repository
Please find below my android/build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.13'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
content {
excludeGroup("com.facebook.react")
}
}
jcenter()
google()
maven { url 'https://www.jitpack.io' }
}
}
same here.
What's the workaround? The same is happening on RN 0.64 after the 0.71 release was launched.
Closing as stale and we haven't seen those kind of errors in a while, so I believe this was transient.