android studio3.0换源,Android Studio 3.0 正式版 踩坑记录

记录一下更新 Studio 3.0 之后所遇到的一些坑~!

1 , Error:Could not find commons-coder.jar(commons-codec:commons-codec:1.6). Searched in the following locations:file:/Applications/Android Studio.app/Contents/gradle/m2repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar

解决方案: 在应用程序中找到 Android Studio, 右键显示包内容 ,追踪到 Applications/Android Studio.app/Contents/gradle/m2repository/commons-codec/commons-codec/1.6/ 目录放入 commons-codec-1.6.jar 文件即可。(文件可自行搜索,或者找他人抄送。ps:上传文件提示重复)

2, Unable to load class ‘org.slf4j.LoggerFactory’.

解决方案: 我这里是直接去下载了一个4.2.1 版本的 Gradle 应用之后解决问题。(Gradle 版本列表)

3,Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

解决方案: 项目根目录的 build.gradle 中 修改如下代码:

buildscript {

repositories {

jcenter()

google()

}

dependencies {

...

classpath 'com.novoda:bintray-release:0.5.0'//修改此处版本号为 0.5.0

...

}

}

4,Unable to load class ‘org.gradle.api.internal.component.Usage’.

解决方案和前一个问题一样

5,Error:No such property: FOR RUNTIME for class: org.gradle.api.attributes.Usage

解决方案: 这个问题出现的原因有点莫名其妙,用 Gradle 4.2.1 编译出现这个问题,更换 Gradle 4.1 编译又没问题了。(ps: 不一定适用所有人)

6,java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

解决方案:

在 app 的 build.gradle 文件中加入一下代码

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android' // 新增

apply plugin: 'kotlin-android-extensions' // 新增

—————————- 暂时就整理了这些。后续遇到问题持续更新。———————

附:

gradle 4.x之后,引入了 implementation 来替代之前版本中的 compile

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值