Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I resolve the compileSdk 34 issue with dependencies requiring compileSdk 35?

I am working on an Android project, and I am encountering the following issue:

When attempting to compile my project, I get the following errors:

5 issues were found when checking AAR metadata:

  1. Dependency 'androidx.activity:activity:1.10.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34.

    Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34.

    Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35.

    Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on).

  2. Dependency 'androidx.activity:activity-compose:1.10.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34.

    Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34.

    Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35.

    Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on).

  3. Dependency 'androidx.activity:activity-ktx:1.10.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34.

    Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34.

    Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35.

    Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on).

  4. Dependency 'androidx.core:core-ktx:1.15.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34.

    Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34.

    Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35.

    Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on).

  5. Dependency 'androidx.core:core:1.15.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34.

    Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34.

    Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35.

    Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on).

I’ve already tried updating compileSdk and targetSdk to version 35 in the build.gradle (module: app) file, but I’m still encountering the issue. I've also checked my gradle-wrapper.properties file to ensure the Gradle version is compatible with Android Gradle Plugin 8.3.0, but the issue persists.

like image 542
michael andika Avatar asked Oct 17 '25 13:10

michael andika


1 Answers

Please Try this way:

gradle-wrapper.properties -->gradle-8.12.1-bin

build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:8.8.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"

build.gradle (module: app)

android {
    compileSdk 35
        defaultConfig {
        applicationId "com.***"
        minSdkVersion 23
        targetSdkVersion 34
...}

But please read and follow the Android SDK Upgrade Assistant.

Tools > Android SDK Upgrade Assistant.
like image 133
Mori Avatar answered Oct 19 '25 05:10

Mori



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!