AndroidStudio环境版本管理
Android Studio Ladybug Feature Drop | 2024.2.2AGP 3.2-8.8 8.8.0
gradle 最低8.10.2
1、JDK
[*]Gradle JDK 17
[*]假如是Android Studio编译,需要把File->Settings->Gradle jdk设置为17
[*]假如是命令行编译,需要把环境变量设置为jdk17
[*]compile JDK
build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
2、gradle版本
gradle version 8.10.2
Android Gradle Plugin Version 8.8.0
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
agp = "8.8.0"
gradle = { module = "com.android.tools.build:gradle", version.ref = "agp" }
3、应用版本
compileSdk = 35
minSdk = 23
targetSdk = 34
Ladybug | 2024.2.1
AGP 3.2-8.7 8.7.3
gradle 最低8.9
1、JDK
[*]Gradle JDK 17
[*]假如是Android Studio编译,需要把File->Settings->Gradle jdk设置为17
[*]假如是命令行编译,需要把环境变量设置为jdk17
[*]compile JDK
build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
2、gradle版本
gradle version 8.9
Android Gradle Plugin Version 8.7.3
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
agp = "8.7.3"
gradle = { module = "com.android.tools.build:gradle", version.ref = "agp" }
3、应用版本
compileSdk = 35
minSdk = 23
targetSdk = 34
Android Studio Koala Feature Drop | 2024.1.2
AGP 3.2-8.6 8.6.1
gradle 最低8.7
1、JDK
[*]Gradle JDK 17
[*]假如是Android Studio编译,需要把File->Settings->Gradle jdk设置为17
[*]假如是命令行编译,需要把环境变量设置为jdk17
[*]compile JDK
build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
2、gradle版本
gradle version 8.7
Android Gradle Plugin Version 8.6.1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
agp = "8.6.1"
gradle = { module = "com.android.tools.build:gradle", version.ref = "agp" }
android-application = { id = "com.android.application", version.ref = "agp" }
3、应用版本
compileSdk = 35
minSdk = 24
targetSdk = 34
Android Studio Giraffe | 2022.3.1 Patch 1
1、JDK
[*]Gradle JDK 17
[*]假如是Android Studio编译,需要把File->Project Structure->Gradle jdk设置为17
[*]假如是命令行编译,需要把环境变量设置为jdk17
[*]compile JDK
build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
kotlinOptions {
jvmTarget = '11'
}
}
2、gradle版本
gradle version 8.0
Android Gradle Plugin Version 8.0.2
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
classpath 'com.android.tools.build:gradle:8.0.2'
3、应用版本
compileSdkVersion = 33
buildToolsVersion = "30.0.0"
minSdkVersion = 21
targetSdkVersion = 26
4、Android Studio Jellyfish或Giraffe编译非常
参见第2条,编译jdk是11,需要在gradlesdk处下载jdk11,下载到默认路径Users\winaccount.jdks\下即可。以便AndroidStudio可以正知识别。
留意:下载完jdk11(只是下载),不要把gradle jdk版本选择jdk11,而还是选择jdk17。
Multiple build operations failed.
Could not create task ':apmlibrary:compileDebugJavaWithJavac'.
Could not create task ':app:compileDebugJavaWithJavac'.
Could not create task ':ComposeUI:compileDebugJavaWithJavac'.
Could not create task ':CpBlindBox:compileDebugJavaWithJavac'.
Could not create task ':CPStrategy:compileDebugJavaWithJavac'.
Could not create task ':Finder:compileDebugJavaWithJavac'.
Could not create task ':glide:compileDebugJavaWithJavac'.
Could not create task ':infra:compileDebugJavaWithJavac'.
Could not create task ':Permission:compileDebugJavaWithJavac'.
Could not create task ':pictureselector:compileDebugJavaWithJavac'.
...and 9 more failures.
Could not create task ':apmlibrary:compileDebugJavaWithJavac'.
Failed to calculate the value of task ':apmlibrary:compileDebugJavaWithJavac' property 'javaCompiler'.
No matching toolchains found for requested specification: {languageVersion=11, vendor=any, implementation=vendor-specific}.
No locally installed toolchains match (see https://docs.gradle.org/8.0/userguide/toolchains.html#sec:auto_detection) and toolchain download repositories have not been configured (see https://docs.gradle.org/8.0/userguide/toolchains.html#sub:download_repositories).
5、内存设置
android studio设置内存巨细
包含3块,gradle、jvm和androidstudio,目前设置都是4G。AndroidStudio默认是1280M,假如不改,用一会就卡了。
AndroidStudio默认是1280M大概是在studio64.exe.vmoptions -Xmx1280m设置的,待验证
您可以在 Android Studio 中调解 JVM(Java 虚拟机)的内存巨细来提升程序的运行效率。要调解 JVM 内存巨细,您需要在 Android Studio 中进行如下设置:
1.在菜单栏中,依次点击 “File” > “Settings”。
2.在 “Settings” 窗口中,找到 “Appearance & Behavior” > “System Settings” > “Memory Settings”。
3.在 “Maximum heap size” 中输入您想要设置的内存巨细(单元为 MB)。
4.点击 “Apply” 按钮保存设置。
留意:
[*]内存设置过大会导致系统资源浪费,影响系统性能。
[*]内存设置过小会导致程序运行速率减慢乃至瓦解。
建议您根据自己的系统资源和项目需求来调解内存巨细。
参考
Android Studio Electric Eel | 2022.1.1
2003之前使用
1、JDK
[*]Gradle JDK 1.8
[*]compile JDK
build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
2、gradle版本
gradle version 6.7.1
Android Gradle Plugin Version 4.2.1
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
classpath 'com.android.tools.build:gradle:4.2.1'
3、应用版本
compileSdkVersion = 30
buildToolsVersion = "30.0.2"
minSdkVersion = 21
targetSdkVersion = 26
版本依赖关系
版本号设置修改
Android Studio Koala各种版本傻傻分不清
官网
Android Studio版本依赖AGP版本
Android Studio 版本时间所需的 AGP 版本Ladybug 功能更新2024.2.23.2-8.8Ladybug2024.2.13.2-8.7Koala 功能更新2024.1.23.2-8.6Koala2024.1.13.2-8.5Jellyfish2023.3.13.2-8.4Iguana2023.2.13.2-8.3Hedgehog2023.1.13.2-8.2Giraffe2022.3.13.2-8.1Flamingo2022.2.13.2-8.0 AGP插件版本依赖Gradle版本
插件版本所需的最低 Gradle 版本8.88.108.78.98.68.78.58.78.48.68.38.48.28.28.18.08.08.07.47.5
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]