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.

相关推荐
Rytter12 小时前
某气骑士 libtprt.so 反 Frida 机制分析与绕过
android·安全·网络安全
alexhilton13 小时前
揭密:Compose应用如何做到启动提升34%
android·kotlin·android jetpack
沐言人生15 小时前
React Native 源码分析1——HybridData 机制深度分析
android·react native
程序员陆业聪15 小时前
跨平台框架全景图:Flutter/KMP/KuiKly/RN的2026年格局
android
码云数智-园园16 小时前
Fibers(纤程)来了:打破阻塞,实现纯PHP下的异步非阻塞IO
android
shaoming377619 小时前
检查系统硬件配置是否满足PyCharm最低要求
android·spring boot·mysql
一起搞IT吧20 小时前
高通Camx功能feature分析之十五:insensor zoom介绍及实现
android·智能手机·相机
aqi0021 小时前
一文读懂 HarmonyOS 6.1 带来的十大重要升级
android·华为·harmonyos·鸿蒙·harmony
秋91 天前
MySQL 9.7.0 使用详解:新特性、实战与避坑指南
android·数据库·mysql
狼与自由1 天前
clickhouse ReplacingMergeTree
android·clickhouse