赞
踩
在进行RK3566 Android 的定制中 遇到一个问题,在使用android stdio开发客制版浏览器的时候,在加载gradle时特别慢,半个多小时还没加载完,最终在网上找到了解决方法,记录一下。
使用阿里提供的仓库进行下载依赖包。阿里仓库网站,包含jcenter、maven、Google仓库,网站是 https://developer.aliyun.com/mvn/guide。
在计算机的c盘的用户目录下找到.gradle,在文件夹内新建文件init.gradle 文件。目录结构如下
在init.gradle加入如下代码,并保存
gradle.projectsLoaded { rootProject.allprojects { buildscript { repositories { def JCENTER_URL = 'https://maven.aliyun.com/repository/public' def GOOGLE_URL = 'https://maven.aliyun.com/repository/google' def NEXUS_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter' all { ArtifactRepository repo -> if (repo instanceof MavenArtifactRepository) { def url = repo.url.toString() if (url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $JCENTER_URL." println("buildscript ${repo.url} replaced by $JCENTER_URL.") remove repo } else if (url.startsWith('https://dl.google.com/dl/android/maven2/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $GOOGLE_URL." println("buildscript ${repo.url} replaced by $GOOGLE_URL.") remove repo } else if (url.startsWith('https://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL." println("buildscript ${repo.url} replaced by $REPOSITORY_URL.") remove repo } } } jcenter { url JCENTER_URL allowInsecureProtocol = true } google { url GOOGLE_URL allowInsecureProtocol = true } maven { url NEXUS_URL allowInsecureProtocol = true } } } repositories { def JCENTER_URL = 'https://maven.aliyun.com/repository/public' def GOOGLE_URL = 'https://maven.aliyun.com/repository/google' def NEXUS_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter' all { ArtifactRepository repo -> if (repo instanceof MavenArtifactRepository) { def url = repo.url.toString() if (url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $JCENTER_URL." println("buildscript ${repo.url} replaced by $JCENTER_URL.") remove repo } else if (url.startsWith('https://dl.google.com/dl/android/maven2/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $GOOGLE_URL." println("buildscript ${repo.url} replaced by $GOOGLE_URL.") remove repo } else if (url.startsWith('https://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL." println("buildscript ${repo.url} replaced by $REPOSITORY_URL.") remove repo } } } jcenter { url JCENTER_URL allowInsecureProtocol = true } google { url GOOGLE_URL allowInsecureProtocol = true } maven { url NEXUS_URL allowInsecureProtocol = true } } } }
然后再把android stdio 重启后发现之前慢吞吞的下载 已经像是吃了菠菜的大力水手一样给力了。
最后将android stdio 重启后发现之前慢吞吞的加载,已经像是吃了菠菜的大力水手一样给力了。
学艺不精,有什么问题希望各位大佬指正。
https://blog.csdn.net/u014687242/article/details/121132481
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。