Android升级版本兼容问题

1、JDK的选择

Android Java API and language features supported
14 (API 34) 17 Core libraries
13 (API 33) 11 Core libraries
12 (API 32) 11 Java API
11 and lower Android 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 version Minimum required Gradle version
8.4 (alpha) 8.6-rc-1
8.3 (beta) 8.4
8.2 8.2
8.1 8.0
8.0 8.0
7.4 7.5

The following table lists which version of Android Gradle plugin(AGP) is required for each version of Android Studio.

Android Studio version Required AGP version
Iguana - 2023.2.1 3.2-8.3
Hedgehog - 2023.1.1 3.2-8.2
Giraffe - 2022.3.1 3.2-8.1
Flamingo - 2022.2.1 3.2-8.0
Electric Eel - 2022.1.1 3.2-7.4

The minimum versions of Android Studio and AGP are as follows:

API level Minimum Android Studio version Minimum AGP version
34 Hedgehog - 2023.1.1 8.1.1
33 Flamingo - 2022.2.1 7.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.

相关推荐
2501_9151063225 分钟前
Perfdog 成本变高之后,Windows 上还能怎么做 iOS APP 性能测试
android·ios·小程序·https·uni-app·iphone·webview
愤怒的代码1 小时前
从开发调试到生产上线:全维度 Android 内存监控与分析体系构建
android·java·kotlin
jzlhll1231 小时前
Android最简化发布模块到mavenCentral
android·mavencentral
2501_915106321 小时前
iOS 安装了证书,HTTPS 还是抓不到
android·网络协议·ios·小程序·https·uni-app·iphone
好奇龙猫2 小时前
【人工智能学习-AI-MIT公开课13.- 学习:遗传算法】
android·人工智能·学习
TO_ZRG2 小时前
Unity打包安卓、iOS知识点
android·unity·android studio
周杰伦fans2 小时前
AndroidStudioJava国内镜像地址gradle
android·java·android-studio
艾莉丝努力练剑2 小时前
【Linux进程控制(一)】进程创建是呼吸,进程终止是死亡,进程等待是重生:进程控制三部曲
android·java·linux·运维·服务器·人工智能·安全
2501_924064112 小时前
2026年移动应用渗透测试流程方案及iOS与Android框架对比
android·ios
用户69371750013842 小时前
谷歌官方推荐:Android 性能优化全攻略——从工具到实战,两周提升 App 评分
android·android studio·android jetpack