menu Littleor's Blog
search
close
Flutter 踩坑记录
3 浏览 | 0 评论

前言

本文是咱初学Flutter时记录一些学习历程的文章,主要记录碰到的坑来分享给大家,避免大家踩坑.

Gradle Resolving dependencies Error

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "/Users/rabbit/develop/android/flutter_app/android/gradlew" exited abnormally:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

当我第一次运行 flutter run 的时候就碰到了这个问题-Android Studio一直卡在创建的界面.
回来谷歌一圈发现是因为我们被墙了,无法访问到google的源
解决办法:

修改Flutter目录下的/packages/flutter_tools/gradle/flutter.gradle 
buildscript {
    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' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

然后再 flutter run 即可

本文作者:小明
本文链接:https://blog.sixming.com/index.php/archives/43/
最后修改时间:2019-11-30 13:06:35
本站未注明转载的文章均为原创,并采用 CC BY-NC-SA 4.0 授权协议,转载请注明来源,谢谢!

评论

textsms
支持Markdown语法
email
link

mode_comment 全部评论 暂无评论(;´д`)ゞ