1.Gradle-7.6.3-all.zip 下载失败
编辑项目中的 gradle/wrapper/gradle-wrapper.properties
文件,并设置 distributionUrl
的值为可靠的镜像站点,如下所示:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
手动下载,然后配置distributionUrl=file:///C:/Users/10245/.gradle/wrapper/dists/gradle-7.6.3-all.zip
2.Gradle 与 java 版本不兼容对照表
3.Unable to find bundled Java version
android studio, Windows系统,jre目录是存在的,不过里面几乎没东西,可以直接将jbr目录内的全部文件复制
一份到jre目录下
4.信号灯超时时间已到
1、找到:flutter\packages\flutter_tools\lib\src\http_host_validator.dart
2、https://maven.google.com/ 修改为https://dl.google.com/dl/android/maven2/
5.flutter pub get
命令来更新项目的依赖项确保你的项目使用了新版本的Flutter SDK
6.应用程序:compileDebugJavaWithJavac
cd android ./gradlew clean ./gradlew wrapper --gradle-version 6.0.1 ./gradlew -v # to download the new version cd .. flutter clean flutter run # might take 15 - 20mins for the first time
7.X Unable to locate Android SDK.
flutter config --android-sdk <你的Android SDK路径>
8.cmdline-tools component is missing
9.Exception caught by widgets library Incorrect use of ParentDataWidget.
这个异常通常发生在使用Flutter的Stack
、Column
、Row
等父级组件时,不正确地使用了ParentDataWidget
。ParentDataWidget
是Flutter中一种特殊的组件,它们依赖于其父级组件的元数据来确定如何布局。例如,Positioned
是Stack
组件的子组件,它使用StackParentData
来确定其在Stack
中的位置。
10. 不安全目录
fatal: detected dubious ownership in repository at 'C:/Users/10245/fvm/versions/3.0.0'
'C:/Users/10245/fvm/versions/3.0.0' is owned by:
'S-1-5-32-544'
but the current user is:
'S-1-5-21-3481359564-3748773214-3631594027-1001'
To add an exception for this directory, call:
git config --global --add safe.directory C:/Users/10245/fvm/versions/3.0.0
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure youtrust this source!
执行 git config --global --add safe.directory C:/Users/10245/fvm/versions/3.0.0