Android项目运行时出错

卡在Initializing gradle…

运行时会卡在Initializing gradle..., 此时因为Android项目会用到Gradle, 如果没有FQ,下载速度会非常慢, 此时我们可以在项目中的android/gradle/wrapper/gradle-wrapper.properties中查看gradle版本号以及地址, 我们可以手动下载然后解压到~/.gradle/wrapper/dists/中。

卡在Running ‘gradle assembleDebug

运行时会卡在Running 'gradle assembleDebug, 因为Gradle的Maven仓库在国外, 可以使用阿里云的镜像地址。

* 修改项目中`android/build.gradle`文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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'
}
} 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' }
}
} rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
} task clean(type: Delete) {
delete rootProject.buildDir
}
* 修改Flutter的配置文件, 该文件在`Flutter安装目录/packages/flutter_tools/gradle/flutter.gradle`
1
2
3
4
5
6
7
8
9
10
11
12
13
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 卡在Running Gradle task 'assembleDebug'...的更多相关文章

  1. 【问题】AndroidStudio导入项目一直卡在Building gradle project infod的最快速解决方案

    原因 AndroidStudio导入项目一直卡在Building gradle project info的原因, 是因为导入的这个项目使用的gradle版本与本地已经拥有的gradle版本不一致,导致 ...

  2. AndroidStudio导入项目一直卡在Building gradle project info最快速解决方案

    AndroidStudio导入项目一直卡在Building gradle project info,实际上是因为你导入的这个项目使用的gradle与你已经拥有的gradle版本不一致,导致需要下载该项 ...

  3. Android Studio导入项目一直卡在Building gradle project info的解决方案

    出现了一个很神奇的现象,Android Studio导入其它项目均正常,但是导入某个项目(两天前还正常打开的项目)却一直卡在Building gradle project info 尝试了重启Andr ...

  4. Gradle task简单使用

    还望支持个人博客站:http://www.enjoytoday.cn task是什么 task是gradle构建脚本的最小运行单元,我们通过在gradle脚本中创建task任务,以期完成某个特定的功能 ...

  5. AndroidTest工程的自定义gradle task

    由于需要将assets目录的资源拷贝到设备sdcard中,然而我的工程是一个android test工程,而android test工程在编译阶段,不会把assets目录的资源打包成对应apk,而为了 ...

  6. Flutter 卡在 package get 的解决办法

    今天在尝试使用Flutter 的时候,需要使用一个第三方库 修改了 pubspec 文件之后,AS 像往常一样提示 需要 package get. 之前都挺正常,不知道今天怎么了. 一直处在 Runn ...

  7. Gradle task

    本文来自网易云社区 作者:孙有军 1:gradle脚本是使用groovy语言写的(DSL),groovy中有一个重要的概念闭包(Closure),Closure是一段单独的代码块,它可以接收参数,返回 ...

  8. [转载]Android Studio卡在refreshing gradle project的原因和快速解决办法

    转载请注明出处:http://blog.csdn.net/u013005791/article/details/60143750 这个问题遇到过很多次,网上也有很多解决办法,但是好像都没有发现refr ...

  9. [Android Tips] 23. How to fail/stop Gradle task immediately if some conditions are not met

    throw new GradleException("conditions are not met") 参考 How to fail/stop task immediately i ...

随机推荐

  1. Python每日一题 008

    题目 基于多线程的网络爬虫项目,爬取该站点http://www.tvtv.hk 的电视剧收视率排行榜 分析 robots.txt User-agent: Yisouspider Disallow: / ...

  2. VIEW当中自定义属性的使用

    主要有三种方法可以实现自定义属性. 第一种方法,直接设置属性值,通过attrs.getAttributeResourceValue拿到这个属性值. (1)在xml文件中设置属性值 [html] vie ...

  3. angular-cli项目报Error encountered resolving symbol values statically. Function calls are not supported.错误的处理。

    安装同事打包的一个模块,报了这么个错,不过在其他地方使用是正常的. Error encountered resolving symbol values statically. Function cal ...

  4. Emgucv图像处理工具

    此工具是当年自己在学习Emgucv的时候,慢慢积累的,包含了常用的图像处理算法,非常适合新人学习,现放出源码,由于是以前做的,功能不全. 当时Emgucv的学习资料非常之少,没有一本书是讲Emgucv ...

  5. 如何用python读写CSV 格式文件

    工作中经常会碰到读写CSV文件的情况.记录下,方便自己以后查询并与大家一起分享: 写CSV文件方法一: import csv          #导入CSV with open("D:\eg ...

  6. https://www.cnblogs.com/limanjihe/p/10184327.html

    https://www.cnblogs.com/limanjihe/p/10184327.html https://blog.csdn.net/xnnswmzdszyd/article/details ...

  7. PHP面试 AJAX基础内容

    AJAX基础内容 Ajax的基本工作原理 Ajax基础概念:通过在后台与服务器进行少量数据交换,Ajax可以使用网页实现异步更新 Ajax工作原理:XMLHttpRequest是Ajax的基础     ...

  8. 启动项目时,Mysql的连接问题

    1.com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection ...

  9. vue事件修饰符(once:prev:stop)

    vue事件修饰符(once:prev:stop) stop修饰符  效果如下: 当你鼠标在这个div里的时候,x与y的值:会随着鼠标的变化而变化.但是当鼠标放在stopMoving的时候,x与y的值是 ...

  10. Android/IOS APP界面设计之尺寸规范

    1.尺寸以及分辨率 iPhone的界面尺寸不用多说,640*960是基本OK的,也可以是适应5S的640*1136,马上iPhone 6也快来了(随便吐槽一下网上曝的真机谍照,真是丑到离谱...),只 ...