美文网首页
Flutter Could not resolve projec

Flutter Could not resolve projec

作者: 锐心凌志 | 来源:发表于2020-06-19 22:04 被阅读0次

遇到这种错误一般是 依赖包 无法下载的问题

步骤1:更新项目的依赖

打开项目的 android/build.gradle文件,将里面的两个repositories改为

 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'
        }
        google()
        jcenter()
    }

步骤2: flutter pub cache clean

步骤3: flutter pub cache repair

步骤4:将下载失败的包的依赖修改

Mac 一般在 /Users/xxx/.pub-cache/hosted/pub.flutter-io.cn

将报错的直接删掉 !

步骤5: 如果是混合开发 到Android项目中 Clear Rebuild

相关文章

网友评论

      本文标题:Flutter Could not resolve projec

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