当前位置: 首页 > news >正文

Android升级版本兼容问题

1、JDK的选择

AndroidJavaAPI and language features supported
14 (API 34)17Core libraries
13 (API 33)11Core libraries
12 (API 32)11Java API
11 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 version
8.4 (alpha)8.6-rc-1
8.3 (beta)8.4
8.28.2
8.18.0
8.08.0
7.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 version
Iguana - 2023.2.13.2-8.3
Hedgehog - 2023.1.13.2-8.2
Giraffe - 2022.3.13.2-8.1
Flamingo - 2022.2.13.2-8.0
Electric Eel - 2022.1.13.2-7.4

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

API levelMinimum Android Studio versionMinimum AGP version
34Hedgehog - 2023.1.18.1.1
33Flamingo - 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.

http://www.lryc.cn/news/289921.html

相关文章:

  • 微信生成带参数二维码(用户id), 扫码可获取用户id
  • 微信小程序(二十一)css变量-定义页面主题色
  • WSL2 Debian系统添加支持SocketCAN
  • Redis的五种常用数据结构以及其底层实现
  • 防御保护笔记
  • C++笔记之作用域解析符::和命名空间、作用域的关系
  • 回归预测 | MATLAB实现PSO-GRNN粒子群优化广义回归神经网络多输入单输出预测(含优化前后预测可视化)
  • linux安装 黑方容灾备份与恢复系统软件v6.0 代理
  • STM32第一节——初识STM32
  • 多场景建模:美团HiNet
  • 第二百九十三回
  • 【网络协议分析】使用Wireshark分析UDP协议
  • TensorFlow Lite中文本分类在Android上的实践
  • 使用vscode查bug
  • LC 2846. 边权重均等查询
  • RabbitMQ简单模式和工作模式
  • c语言实战之贪吃蛇
  • Midjourney图片生成描述词记录(今天一天)
  • 类和对象 第五部分第四小节:赋值运算符重载
  • Django从入门到精通(一)
  • 数据库分表分库的原则
  • Java技术栈 —— Docker容器
  • Mysql大数据量分页优化
  • QT tcp与udp网络通信以及定时器的使用 (7)
  • web架构师编辑器内容-添加自动保存的功能
  • 【Redis】关于它为什么快?使用场景?以及使用方式?为何引入多线程?
  • SpringBoot之JWT登录
  • 【备战蓝桥杯】——循环结构
  • 【数据分享】1929-2023年全球站点的逐年平均气温数据(Shp\Excel\免费获取)
  • 探索Pyecharts关系图绘制技巧:炫酷效果与创意呈现【第42篇—python:Pyecharts水球图】