Resolving ':app' Execution Failure Due to androidx.core:core Dependency Conflict
Problem Statement
When building an Android project, you may encounter the following critical error:
Execution failed for task ':app:checkDebugAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
An issue was found when checking AAR metadata:
1. Dependency 'androidx.core:core:1.15.0-alpha01' requires libraries and applications that
depend on it to compile against version 35 or later of the Android APIs.
Key issues highlighted by the error message:
- The dependency
androidx.core:core:1.15.0-alpha01
requires minimum Android API level 35 - Your project is currently compiled against Android API level 34 or lower
- Your Android Gradle Plugin version (8.1.1) has maximum recommended compile SDK version 34
Common additional issues you might face:
- "Failed to find Platform SDK with path: platforms;android-35" (missing SDK installation)
- Persisting errors even after manually downgrading
androidx.core
version - Play Store submisson warnings when building with preview versions
Why This Occurs
androidx.core:core:1.15.0-alpha01
is an Alpha Release - it requires API 35 features while your project targets API 34. Either an explicit dependency or a transitive dependency (via another library) is pulling this unstable version.
Recommended Solutions
Solution 1: Force Stable Core Library Version (Recommended)
Add a resolution strategy to override the core dependency with a stable version:
android {
// ... other configurations ...
}
dependencies {
// ... your dependencies ...
}
configurations.all {
resolutionStrategy {
force "androidx.core:core:1.13.1"
force "androidx.core:core-ktx:1.13.1" // If using Kotlin extensions
}
}
Kotlin DSL version
android {
// ... your existing configuration ...
}
dependencies {
// ... your dependencies ...
}
configurations.all {
resolutionStrategy {
force("androidx.core:core:1.13.1")
force("androidx.core:core-ktx:1.13.1")
}
}
Why this works: This globally forces all dependencies to use the specified stable version, overriding any alpha/beta versions pulled transitively.
Solution 2: Update Compile SDK to Android 35
Step 1: Install Required SDK
- Open Android Studio → Tools → SDK Manager
- Check Android 15 (VanillaIceCream) under SDK Platforms
- Verify API level is 35 and Build Tools version
- Click Apply to install
Step 2: Update Gradle Configurations
android {
compileSdk 35 // Update to API 35
defaultConfig {
targetSdk 34 // Can remain at 34 initially
// ...
}
// ...
}
Kotlin DSL version
android {
compileSdk = 35
defaultConfig {
targetSdk = 34
// ...
}
}
Step 3: Update Android Gradle Plugin
dependencies {
classpath 'com.android.tools.build:gradle:8.3.0' // Update to latest stable
}
Solution 3: Manual Dependency Version Specification
Dangerous if used carelessly, but effective with proper verification:
dependencies {
// Explicitly specify stable core version
implementation "androidx.core:core:1.13.1"
// If using libraries with version catalogs (libs.xxx)
implementation libs.androidx.core.ktx.v1131
}
Solution 4: Identify Problematic Transitive Dependencies
Run dependency insight check:
./gradlew app:dependencyInsight --configuration implementation --dependency androidx.core:core
Example output will show which dependency pulls the unstable version. You can then:
implementation('problematic-library') {
exclude group: 'androidx.core', module: 'core'
}
implementation "androidx.core:core:1.13.1" // Add stable version explicitly
Best Practices
Never use
+
in dependency versions:diff- implementation 'com.google.android.gms:play-services-ads:+' + implementation 'com.google.android.gms:play-services-ads:23.5.0'
Verify third-party libraries (especially expo/react-native plugins) for compatibility
Regularly audit dependencies with
./gradlew app:dependencies
Use stable release tags in documentation (AndroidX Release Notes)
Production Warning
Avoid using compileSdkPreview "VanillaIceCream"
, as it may generate APKs rejected by Play Store with "App not installed as package appears to be invalid".
When All Else Fails
If the issue persists, systematically identify the culprit:
- Create a new minimal project
- Add dependencies one-by-one until error reappears
- Inspect the problematic library:
- Report issue to library maintainers
- Find alternative libraries
- Temporarily downgrade/remove the dependency
Common problematic libraries include:
react-native-screen-brightness
@adrianso/react-native-device-brightness
Conclusion
Solution | Best For | Notes |
---|---|---|
Resolution Strategy | Quick fix, legacy projects | Does not require SDK changes |
Compile SDK Update | Long-term projects | Requires API 35 SDK & latest plugin |
Manual Versioning | Simple projects, small apps | Risk of version conflicts |
Dependency Exclusion | Transitive dependency issues | Requires diagnostic steps |
For most projects, Solution 1 (resolution strategy) provides the fastest path to resolution without configuration changes. If you're starting a new project or require Android 15 features, Solution 2 (SDK update) is the future-proof approach.
Always verify dependency trees regularly and prefer stable library versions to prevent alpha/beta dependencies from entering your build pipeline.