1.6K Star 5.5K Fork 3.7K

开源中国/android-app

 / 详情

编译报错:Error:Unable to load class 'org.gradle.logging.StyledTextOutput$Style'.

已验收
任务
创建于  
2017-04-30 15:37

编译报错:

Error:Unable to load class 'org.gradle.logging.StyledTextOutput$Style'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

**我使用的环境:
**
Android Studio版本:2.3.1
gradle-wrapper.properties:distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
build.gradle: classpath 'com.android.tools.build:gradle:2.3.1'

根据网上查到的资料:

  1. https://github.com/dcendents/android-maven-gradle-plugin/issues/43
  2. http://stackoverflow.com/questions/42581534/android-studio-2-3-gradle-error

我感觉是gradle版本配置的问题,我尝试着进行如下修改:
gradle-wrapper.properties:distributionUrl=https://services.gradle.org/distributions/g‌​radle-2.14.1-all.zip
build.gradle: classpath 'com.android.tools.build:gradle:2.2.3'

但是还一直是报这个错误!

请问:

  1. 会不会是依赖的一些苦需要的gradle版本,导致的问题?
  2. 跟我环境一样的同学,有没有碰到过这个问题?
  3. 我该怎么解决这个错误呢?

评论 (15)

张庚 创建了任务 8年前

看一看版本发布的新闻,再看一看其他的issue就知道了。

https://www.oschina.net/news/83347/oschina-android-app-v283-open-source

输入图片说明

巴拉迪维 关闭了任务 8年前
巴拉迪维 指派了任务给巴拉迪维 8年前

可以跑起来了! 多谢!之前没看这个文档的问题,谢谢!

gradle怎么不换成较新的版本呢?

升级到 classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.4',Gradle用3.3的就能解决这个问题

老哥,你换到grale。2.14.1就ok了,不用谢。。。。

巴拉迪维 验收了任务 8年前

升级classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.4'

就可以了

张庚 关闭了任务 8年前
巴拉迪维 验收了任务 8年前

楼上正解

楼上正解

楼上正解!!!

楼上正解

楼上正解!

Error:A problem occurred configuring project ':app'.

Could not generate a proxy class for class com.getkeepsafe.dexcount.DexMethodCountTask. 这是什么问题了

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(14)
355540 barat 1648637535 441837 zhanggeng 1578923977 luwenhua-longdi123 130588 idong 1578918912 1001567 bozaixing 1591942829 王月明qq-yy1994_admin MiraclesHed-miracleshed jdsjlzx-jdsjlzx 1350255 leelugen 1614151310 1236015 chuwe1 1578947060 lizhicheng-hellobmb 562419 simune 1578927739
加载更多
Android
1
https://gitee.com/oschina/android-app.git
git@gitee.com:oschina/android-app.git
oschina
android-app
android-app

搜索帮助