flutter使用报错(vscode开发)

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 版本不兼容对照表

Compatibility Matrix

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的StackColumnRow等父级组件时,不正确地使用了ParentDataWidgetParentDataWidget是Flutter中一种特殊的组件,它们依赖于其父级组件的元数据来确定如何布局。例如,PositionedStack组件的子组件,它使用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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值