Flutter 第二篇

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

相关推荐
sunly_2 小时前
Flutter:AnimatedPadding动态修改padding
android·flutter
LinXunFeng7 小时前
Flutter - 子部件任意位置观察滚动数据
前端·flutter·开源
leluckys12 小时前
flutter 专题十二 Flutter Fair逻辑动态化架构设计与实现
flutter
sunly_13 小时前
Flutter:AnimatedIcon图标动画,自定义Icon通过延时Interval,实现交错式动画
flutter
嘟嘟叽13 小时前
初学 flutter 问题记录
flutter
__WanG13 小时前
Flutter将应用打包发布到App Store
前端·flutter·ios
leluckys13 小时前
flutter 专题十七 Flutter Flar动画实战
前端·flutter
sunly_14 小时前
Flutter:AnimatedBuilder自定义显示动画
flutter
leluckys14 小时前
flutter 专题十一 Fair原理篇Fair逻辑动态化架构设计与实现
flutter
Jinkey1 天前
FlutterBasic - GetBuilder、Obx、GetX<Controller>、GetxController 有啥区别
android·flutter·ios