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. POJ 1273 Drainage Ditches (网络流Dinic模板)

    Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover ...

  2. APICloud框架——总结一下最近开发APP遇到的一些问题 (二)

    高度自适应 flex布局 允许子元素伸缩 手机号正则 function checkPhone(data){ if(!(/^1[34578]\d{9}$/.test(data))){ alert(&qu ...

  3. H5 调用 手机设备的功能

    1.调用 邮件 : 参考 https://blog.csdn.net/github_38516987/article/details/77637546 (亲测有效) <a href=" ...

  4. 【Shiro】二、Apache Shiro配置

    1.配置 使用配置获得SecurityManager,SecurityManager是核心,配置好并获取到SecurityManager,Shiro就算正式运行起来了. 两种方式:通过ini文件:通过 ...

  5. 汇编学习(1)——win7 64位调出debug

      一.安装方法: 1.下载一个dosbox和win7 32位debug.exe,安装dosbox,打开页面 2. 将debug.exe放入磁盘根目录,这里以D盘为例.在dosbox中输入mount ...

  6. gdb流程控制(例: 循环打印数组)

    参考:https://blog.csdn.net/justlinux2010/article/details/9453151 循环/条件 在gdb的脚本中循环遍历整个哈希表,并且加上判断条件来进行统计 ...

  7. java 并发——ReentrantLock

    java 并发--ReentrantLock 简介 public class ReentrantLock implements Lock, java.io.Serializable { // 继承了 ...

  8. DB2连接

    ibm_db.connect 创建非持久连接. ibm_db.pconnect 创建持久连接. 在最初的Python脚本请求之后,持久的连接保持打开状态,这允许后续的Python请求重新使用连接. 后 ...

  9. moment.js 快捷查询

    格式化日期 当前时间: moment().format('YYYY-MM-DD HH:mm:ss'); //2014-09-24 23:36:09 今天是星期几: moment().format('d ...

  10. Guava之controller中使用缓存cache

    之前介绍过的Guava这个工具包中有很多方便的用法,下面要使用它封装的Cache来实现功能. 示例: import com.google.common.cache.CacheBuilder; impo ...