1、第一步
async: 2.4.0 audio_recorder: 1.0.2
2、点击右上角 更新
大部分红线没有了
卡在
3、运行在模拟器里面
Running Gradle task 'assembleDebug'...
报错一:
* Where: Build file '/Users/guoxingdeng/AndroidStudioProjects/fltteraistock/android/app/build.gradle' line: 2 * What went wrong: 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 /Applications/Android Studio.app/Contents/jre/Contents/Home 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
. * Try: > Run with --stacktrace option to get the stack trace.
解决方案:
- 找到
android/gradle.properties
文件。 - 添加以下内容,确保 Gradle 使用正确的 JDK 路径
org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home