android studio 3.0 canary 5下载,Android Studio 3.0 Canary 5 -錯誤:無法加載class ' org.gradle.api.inal.compon...

I have read through all of the existing stack questions relating to this and their solutions did not help me.

我已經閱讀了所有與此相關的現有堆棧問題,它們的解決方案對我沒有幫助。

This problem has been evident since all AS updates above 2.3.

這個問題很明顯,因為所有更新都在2.3以上。

Creating a new project is ok and builds

創建一個新項目是可以的,可以構建

I've attempted to copy all values from the 'new project' but it still persists

我試圖從“新項目”中復制所有值,但它仍然存在

The error:

錯誤:

Error:Unable to load class 'org.gradle.api.internal.component.Usage'. Possible causes for this unexpected error include:

錯誤:無法加載class org.gradle.api.internal. components . usage。這種意外錯誤的可能原因包括:

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

Gradle的依賴緩存可能會損壞(有時會在網絡連接超時后發生)。重新下載依賴項和同步項目(需要網絡)

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版本不兼容。In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

gradle-wrapper.properties

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip

Project build.gradle

項目build.gradle

buildscript {

repositories {

google()

jcenter()

}

dependencies {

classpath 'com.android.tools.build:gradle:3.0.0-alpha5'

classpath "io.realm:realm-gradle-plugin:0.89.1"

}

}

allprojects {

repositories {

google()

jcenter()

maven { url 'https://jitpack.io' }

}

}

task clean(type: Delete) {

delete rootProject.buildDir

}

Settings Gradle

設置它

Use default gradle wrapper

Module Settings

模塊設置

Compile Sdk Version: API 26

Build Tools Version: 26.0.0

I believe these are all the latest available. And I have tried invalidate caches & restart / rebooting the machine

我相信這些都是最新的。我已經嘗試了無效緩存和重新啟動/重新啟動機器

2 个解决方案

#1

30

I tried all the above suggestions for deleting cache and nothing worked for me. In the end, the problem was the plugin com.novoda:bintray-release:0.4.0. When I upgraded it to 0.5.0, it worked.

我嘗試了以上所有刪除緩存的建議,但都沒有奏效。最終,問題是插件com.novoda:bintray-release:0.4.0。當我把它升級到0。5.0時,它成功了。

I would take a hard look at your gradle plugins!

我要好好看看你的gradle插件!

#2

0

Delete Gradle cache C:/users//.gradle (delete the whole directory actually). Then upgrade Gradle and try again.

刪除緩存Gradle C:/ / < yourname > /用戶。漸變(實際上刪除整個目錄)。然后升級等級,再試一次。

Or if you are using Gradle wrapper go into properties and upgrade the version of the wrapper ./gradle/wrapper/gradle-wrapper.properties

或者,如果您正在使用漸變包裝器,請進入屬性並升級該包裝器的版本

Your question doesn't specify the versions, then I assume this might be your problem.

您的問題沒有指定版本,然后我假設這可能是您的問題。

Edit: Check if your plugins are still Compatible with your version of Gradle

編輯:檢查你的插件是否仍然與你版本的Gradle兼容

io.realm:realm-gradle-plugin:0.89.1 seems a bit old there is a version 3.5.0 already

領域:realm-gradle-plugin:0.89.1版本似乎有點過時了,已經有了3.5.0版本

Since Gradle 3.4 Usage was renamed to UsageContext and maybe one of your plugins, or dependencies is not compatible with Gradle 4.1-milestone that you are using by looking at the distribution Url.

由於Gradle 3.4的使用被重命名為UsageContext,或者您的一個插件或依賴項與您通過查看分發Url所使用的Gradle 4.1-milestone不兼容。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值