添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

问题背景:当我升级AS到Bumblebee版本之后,打开某一project发现根目录的build.gradle中配置的kotlin-gradle-plugin由1.5.20自动给升级到了1.5.30.但是项目预编译的过程中始终显示kotlin-daemon-embeddable 1.5.30在下载中,打开本地C盘.gradle的如下目录

上图是我下载成功之后的状态,可知 kotlin-compiler-embeddable插件下载的位置为:C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-daemon-embeddable,下载成功之前该目录下只有一个文件夹,且里面的文件只有3kb,可推断是因为网络原因没能成功及时下载下来。

可通过在根目录的build.gradle中配置阿里云的镜像,实现下载。配置如下:

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }

以上的配置是基于本地AS版本为bumblebee,其他低版本有些差异,请加以注意。配置完成后再次编译项目之后就可以观察到该插件很快在下载中直至成功下载。

参考文献:

Could not download kotlin-compiler-embeddable.jar_冷冷清清里风风火火是我-程序员宝宝 - 程序员宝宝

 2 ​​​​​​AS工程:kotlin plugin无法加载的问题 - 掘金

Execution failed for task ':app:checkDebugAarMetadata'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.3.20. Searched maven { url 'https://maven.aliyun.com/repository/public/' } maven { url 'https://maven.aliyun.com/repository/google/'} maven { url 'https://maven.aliyun.co 2. 代码展示: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.4.31" repositories 打开工程文件根目录 build.gradle 在 buildscript 和 allprojects 的 repositories 中分别注释掉 jcenter(),并使用国内镜像进行替换:maven{url ‘http://maven.aliyun.com/nexus/content/groups/public/’} 在 buildscript 的 repositories 添加:maven{url “https://jitpack.io”} github拉代码出现:error: RPC failed; curl 18 transfer closed with outstanding read data remaining xxx。 AndroidStudio AGP 7+, 编译aar并输出到本地仓库