Tôi đã đọc qua tất cả các câu hỏi ngăn xếp hiện có liên quan đến vấn đề này và các giải pháp của họ không giúp tôi.Android Studio 3.0 Canary 5 - Lỗi: Không thể tải lớp 'org.gradle.api.internal.component.Usage'
- Vấn đề này đã được hiển nhiên vì tất cả các cập nhật AS ở trên 2.3.
- Tạo một dự án mới là ok và xây dựng
- Tôi đã cố gắng để sao chép tất cả các giá trị từ các 'dự án mới' nhưng nó vẫn còn dai dẳng
Lỗi:
Error:Unable to load class 'org.gradle.api.internal.component.Usage'. Possible causes for this unexpected error include:
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
- 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- 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
Dự án 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
}
Cài đặt Gradle
Use default gradle wrapper
Cài đặt module
Compile Sdk Version: API 26
Build Tools Version: 26.0.0
Tôi tin rằng đây là tất cả các mới nhất hiện có. Và tôi đã thử bộ nhớ cache không hợp lệ & khởi động lại/khởi động lại máy
https://github.com/dcendents/android-maven-gradle-plugin/issues/43 –
Tôi không chắc chắn điều đó có liên quan như thế nào, cũng như tôi không tìm thấy giải pháp trong đó? Bất kỳ bình luận đặc biệt mà bạn nghĩ rằng tôi nên đọc? Tất cả các phiên bản của tôi đều lớn hơn phiên bản được đề cập trong chuỗi đó. – behelit