【android studio 新建项目插件版本报错】

Android Studio插件升级以后kotlin jdk版本冲突

今天新建kotlin项目时出现插件版本的保存,发现是新版本插件需要提高支持的sdk版本,发出来希望可以帮助到同样报错的同学

报错

8 issues were found when checking AAR metadata:

  1. Dependency ‘androidx.navigation:navigation-common:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 8.0.2 is 33.

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

    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.navigation:navigation-common-ktx:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 8.0.2 is 33.

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

    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.navigation:navigation-runtime:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 8.0.2 is 33.

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

    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.navigation:navigation-ui:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 8.0.2 is 33.

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

    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.navigation:navigation-runtime-ktx:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 8.0.2 is 33.

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

    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).

  6. Dependency ‘androidx.navigation:navigation-ui-ktx:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 8.0.2 is 33.

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

    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).

  7. Dependency 'a

在这里插入图片描述

方案

build.gradle文件中修改kotlin-stdlib-jdk加载方式
在这里插入图片描述

把支持最高sdk的版本改成34就好了,因为34的sdk版本比较高,所以可以需要Android Gradle plugin 版本也比较高才行,我用的是8.0.2版本,可以在下面这里改
在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/LLCCQAQ/article/details/132192929