美文网首页Flutter
[完美解决方案]Could not determine the

[完美解决方案]Could not determine the

作者: truemi | 来源:发表于2021-05-10 16:32 被阅读0次

    新建Flutter项目Android项目后,点击运行出现报错!

    error.png
    这是镜像站点无法访问造成的!只需要修改为国内可访问的站点即可。

    第一步:修改项目Android目录下的build.gradle

    buildscript {
        ext.kotlin_version = '1.3.50'
        repositories {
    //        google() 无法访问,使用阿里镜像
    //        jcenter()
            maven { url 'https://maven.aliyun.com/repository/google' }
            maven { url 'https://maven.aliyun.com/repository/jcenter' }
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
            maven { url 'http://download.flutter.io'}
    
        }
    
    allprojects {
        repositories {
    //        google()
    //        jcenter()
            maven { url 'https://maven.aliyun.com/repository/google' }
            maven { url 'https://maven.aliyun.com/repository/jcenter' }
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
        }
    }
    

    第二步:修改flutter SDK中的flutter.gradle

    path: flutter\packages\flutter_tools\gradle\flutter.gradle

    buildscript {
        repositories {
            maven { url 'https://maven.aliyun.com/repository/google' }
            maven { url 'https://maven.aliyun.com/repository/jcenter' }
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.0'
        }
    }
    

    相关文章

      网友评论

        本文标题:[完美解决方案]Could not determine the

        本文链接:https://www.haomeiwen.com/subject/qyyidltx.html