1. 程式人生 > >Unable to load class 'org.gradle.api.internal.component.Usage'

Unable to load class 'org.gradle.api.internal.component.Usage'

前言

我的執行環境:

Ubuntu16.04系統
Android Studio 3.0 版本

下載https://github.com/JessYanCoding/ProgressManager示例後,在工程的build.gradle裡面修該成我本地的版本如下:

這裡寫圖片描述

在編譯的時候就出現了以下錯誤:

Error:Unable to load class '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. In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

解決

這是由於外掛相容問題導致的錯誤,如果有com.novoda:bintray-release請把版本修改為0.5.0

感謝weixin_41101173的提示,對於大於AndroidStudio3.14版本的,請改為0.8.0

這裡寫圖片描述

再次編譯就ok了。