Skip to content

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:

text
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:

  1. The dependency androidx.core:core:1.15.0-alpha01 requires minimum Android API level 35
  2. Your project is currently compiled against Android API level 34 or lower
  3. 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.

Add a resolution strategy to override the core dependency with a stable version:

groovy
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
kotlin
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

  1. Open Android Studio → Tools → SDK Manager
  2. Check Android 15 (VanillaIceCream) under SDK Platforms
    • Verify API level is 35 and Build Tools version
  3. Click Apply to install

Step 2: Update Gradle Configurations

groovy
android {
    compileSdk 35  // Update to API 35
    
    defaultConfig {
        targetSdk 34  // Can remain at 34 initially
        // ...
    }
    // ...
}
Kotlin DSL version
kotlin
android {
    compileSdk = 35
    
    defaultConfig {
        targetSdk = 34
        // ...
    }
}

Step 3: Update Android Gradle Plugin

groovy
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:

groovy
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:

bash
./gradlew app:dependencyInsight --configuration implementation --dependency androidx.core:core

Example output will show which dependency pulls the unstable version. You can then:

groovy
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:

  1. Create a new minimal project
  2. Add dependencies one-by-one until error reappears
  3. Inspect the problematic library:
    • Report issue to library maintainers
    • Find alternative libraries
    • Temporarily downgrade/remove the dependency

Common problematic libraries include:

text
react-native-screen-brightness 
@adrianso/react-native-device-brightness

Conclusion

SolutionBest ForNotes
Resolution StrategyQuick fix, legacy projectsDoes not require SDK changes
Compile SDK UpdateLong-term projectsRequires API 35 SDK & latest plugin
Manual VersioningSimple projects, small appsRisk of version conflicts
Dependency ExclusionTransitive dependency issuesRequires 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.