java 无法加载类“org.gradle.api.internal.component.Usage”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47739694/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to load class 'org.gradle.api.internal.component.Usage'
提问by Jaeger
after upgrading to the latest stable version of Android Studio with Gradle 4.2, I'm unable to do my projects or anything, and still having these issues. Even tho I've created a new project, and couldn't do it.
使用 Gradle 4.2 升级到最新的稳定版 Android Studio 后,我无法执行我的项目或任何事情,并且仍然遇到这些问题。即使我已经创建了一个新项目,也无法做到。
Any suggestions?
有什么建议?
Error:Unable to load class 'org.gradle.api.internal.component.Usage'
错误:无法加载类“org.gradle.api.internal.component.Usage”
Possible causes for this unexpected error include:
此意外错误的可能原因包括:
- Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
- The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
- 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.
- Gradle 的依赖缓存可能已损坏(有时会在网络连接超时后发生。)重新下载依赖项并同步项目(需要网络)
- Gradle 构建进程(守护进程)的状态可能已损坏。停止所有 Gradle 守护进程可能会解决这个问题。停止 Gradle 构建进程(需要重启)
- 您的项目可能使用了第三方插件,该插件与项目中的其他插件或项目要求的 Gradle 版本不兼容。
My gradle's build:
我的gradle构建:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation project(':libs:searchview')
implementation project(':libs:AndroidImageSlider')
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:customtabs:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.stfalcon:frescoimageviewer:0.5.0'
implementation 'com.facebook.fresco:fresco:1.3.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'jp.wasabeef:picasso-transformations:2.1.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'org.jsoup:jsoup:1.9.2'
implementation ('com.squareup.retrofit2:converter-gson:2.0.2'){
exclude group: 'org.apache.commons', module: 'commons-io'
}
implementation ('com.squareup.retrofit2:retrofit-converters:2.0.2'){
exclude group: 'org.apache.commons', module: 'commons-io'
}
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.klinkerapps:drag-dismiss-activity:1.5.0'
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
implementation 'com.roughike:bottom-bar:2.3.1'
implementation 'pub.devrel:easypermissions:1.1.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation('com.sangcomz:FishBun:0.7.7@aar') {
transitive = true
}
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
回答by zhijian lin
Thanks, I have solved this problem! This problem appears because the gradle I used 's version is 3.4.1
, and it is not compatible with the plugin 'com.novoda:bintray-release:0.4.0'
's gradle version, when I upgrade it to 0.5.0
, it works.The answer is helping me solve that problem! Wish can help you!
谢谢,我已经解决了这个问题!出现这个问题是因为我用的gradle的版本是3.4.1
,和插件'com.novoda:bintray-release:0.4.0'
的gradle版本不兼容,升级到0.5.0
就可以了。答案就是帮我解决这个问题!愿能帮到你!