Android Studio Flamingo编译项目问题记录

系统版本:macOS 13.4

Android Studio Flamingo | 2022.2.1 Patch 2

下载地址:Download Android Studio & App Tools - Android DevelopersAndroid Studio provides app builders with an integrated development environment (IDE) optimized for Android apps. Download Android Studio today.https://developer.android.google.cn/studio

所需插件版本:3.2-8.0,gradle 8.0

更新gradle插件及环境变量

Mac环境变量配置
1. 进入当前用户的home路径:cd ~/
2. 创建.bash_profile文件:touch .bash_profile
3. 打开.bash_profile文件:open .bash_profile
4. 使配置文件生效:source .bash_profile

编译问题

  • No matching variant of com.android.tools.build:gradle:8.0.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0'

解决方案:将gradle的Java JDK版本修改为11

Android Studio Flamingo编译项目问题记录_第1张图片

  • Android Gradle plugin requires Java 17 to run. You are currently using Java 11. Your current JDK is located in /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home

解决方案:下载并选择Java 17

Android Studio Flamingo编译项目问题记录_第2张图片

 

你可能感兴趣的:(android,studio,android,ide)