flutter问题汇总

一直卡在building a flutter app for general distribution;

AS Message窗口显示 依赖下载失败:

1、修改仓库地址的配置:android/build.gradle

  repositories {
        maven { url 'https://download.flutter.io' }
        maven { url "https://maven.aliyun.com/repository/public" }
        maven { url "https://maven.aliyun.com/repository/central" }
        maven { url "https://maven.aliyun.com/repository/jcenter" }
        maven { url "https://maven.aliyun.com/repository/google" }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
//        maven { url "https://maven.aliyun.com/repository" }
        mavenLocal()
        mavenCentral()
//        google()
//        jcenter()
//        gradlePluginPortal()
//        maven { url 'https://repo1.maven.org/maven2/' }
//        maven { url 'https://jitpack.io' }
   }

2、因为setting.gradle中有这个配置:

apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

所以还要去修改flutter-tools中的配置:
…\FlutterSdk\flutter_windows_3.0.5\packages\flutter_tools\gradle\flutter.gradle

repositories {
        maven { url "https://maven.aliyun.com/repository/public" }
        maven { url "https://maven.aliyun.com/repository/central" }
        maven { url "https://maven.aliyun.com/repository/jcenter" }
        maven { url "https://maven.aliyun.com/repository/google" }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
        google()
        mavenCentral()
    }

注意:3.13 以上的版本,需要修改下面两个文件:

flutter_windows_3.13.2\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy
flutter_windows_3.13.2\packages\flutter_tools\gradle\resolve_dependencies.gradle

Error: A value of type ‘AbstractNode?’ can’t be assigned to a variable of type ‘RenderObject?’. #22

使用 flutter sdk 3.13 以版本;

你可能感兴趣的:(Flutter,flutter,dart,android)