柚子快報(bào)邀請(qǐng)碼778899分享:Android升級(jí)版本兼容問題
柚子快報(bào)邀請(qǐng)碼778899分享:Android升級(jí)版本兼容問題
1、JDK的選擇
AndroidJavaAPI and language features supported14 (API 34)17Core libraries13 (API 33)11Core libraries12 (API 32)11Java API11 and lowerAndroid versions
https://developer.android.com/build/jdks
The following table lists which version of Gradle is required for each version of the Android Gradle plugin. For the best performance, you should use the latest possible version of both Gradle and the plugin.
Plugin versionMinimum required Gradle version8.4 (alpha)8.6-rc-18.3 (beta)8.48.28.28.18.08.08.07.47.5
The following table lists which version of Android Gradle plugin(AGP) is required for each version of Android Studio.
Android Studio versionRequired AGP versionIguana - 2023.2.13.2-8.3Hedgehog - 2023.1.13.2-8.2Giraffe - 2022.3.13.2-8.1Flamingo - 2022.2.13.2-8.0Electric Eel - 2022.1.13.2-7.4
The minimum versions of Android Studio and AGP are as follows:
API levelMinimum Android Studio versionMinimum AGP version34Hedgehog - 2023.1.18.1.133Flamingo - 2022.2.17.2
https://developer.android.com/build/releases/gradle-plugin
Make sure to choose a JDK version that is higher than or equal to the JDK versions used by plugins that you use in your Gradle build. To determine the minimum required JDK version for the Android Gradle Plugin (AGP), see the compatibility table in the release notes.
For example, the Android Gradle Plugin version 8.x requires JDK 17. If you try to run a Gradle build that uses it with an earlier version of the JDK, it reports a message like:
An exception occurred applying plugin request [id: ‘com.android.application’]
Failed to apply plugin ‘com.android.internal.application’. Android Gradle plugin requires Java 17 to run. You are currently using Java 11. Your current JDK is located in /usr/local/buildtools/java/jdk11 You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing org.gradle.java.home in gradle.properties.
柚子快報(bào)邀請(qǐng)碼778899分享:Android升級(jí)版本兼容問題
好文鏈接
本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點(diǎn)和立場。
轉(zhuǎn)載請(qǐng)注明,如有侵權(quán),聯(lián)系刪除。