'android-25' requires JDK 1.8 or later to compile

本文介绍了解决Android Studio中因JDK版本不匹配导致的编译错误问题。通过检查并确保项目设置中的JDK路径指向正确的JDK 1.8目录来解决此问题。

Error:Execution failed for task':app:compileDebugJavaWithJavac'.

> compileSdkVersion 'android-25'requires JDK 1.8 or later to compile.



android studio 编译出现上面错误,但明明jdk已经更新到1.8且配置成功了,搞了半天总算解决,方法如下:

File > Project Structure > see if JDK location points to your JDK 1.8 directory.



android studio中AGP版本在哪查看,怎么升级7 issues were found when checking AAR metadata: 1. Dependency 'androidx.activity:activity:1.10.1' 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.5.1 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.1' 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.5.1 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.1' 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.5.1 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.16.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.5.1 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-ktx:1.16.0' requires Android Gradle plugin 8.6.0 or higher. This build currently uses Android Gradle plugin 8.5.1. 6. Dependency 'androidx.core:core:1.16.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.5.1 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). 7. Dependency 'androidx.core:core:1.16.0' requires Android Gradle plugin 8.6.0 or higher. This build currently uses Android Gradle plugin 8.5.1.
最新发布
05-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值