【问题标题】:Unable to load class 'org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginModelBuilderService'无法加载类“org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginModelBuilderService”
【发布时间】:2020-06-15 16:30:13
【问题描述】:

升级到最新稳定版 Android Studio 后,我得到了这个,无法启动项目

https://i.stack.imgur.com/hQhNw.png

【问题讨论】:

  • 能否提供一点代码 sn-p 以便我们更深入地研究问题?
  • 对不起,这是我的第一篇文章。我编辑所以你可以看到代码
  • 我有同样的问题。我的设置。我在 intellij 而不是 android studio。我通过代理连接到互联网
  • @rakeshkashyap 我解决了这个问题,你必须删除所有与 Android Studio 相关的文件,当你再次安装它时会出现一个窗口来导入设置,你必须选择不导入设置。

标签: java android-studio kotlin installation


【解决方案1】:

我可以通过删除 Gradle 缓存并重新启动 Android Studio 来解决此问题:

rm -rf ~/.gradle

【讨论】:

    【解决方案2】:

    这不是我给出的最佳解决方案,但它帮助我解决了问题并继续...... 所以首先,转到gradle-wrapper.properties,这应该是你的代码:

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
    

    然后转到build.gradle(:app),这是我解决问题后的代码:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 30
        buildToolsVersion "30.0.2"
    
        defaultConfig {
            applicationId "com.example.infogram"
            minSdkVersion 16
            targetSdkVersion 30
            versionCode 1
            versionName "1.0"
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: "libs", include: ["*.jar"])
        implementation 'androidx.appcompat:appcompat:1.2.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
        implementation 'androidx.recyclerview:recyclerview:1.1.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.2'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    
    }
    

    记住,在依赖部分你可以另外添加其他代码,但只需检查公共代码的版本与我的依赖代码是否相同!

    【讨论】:

      【解决方案3】:

      我有同样的问题,你需要更新 gradle-wrapper.properties 文件中的 distributionUrl,只需复制版本号并替换你拥有的任何内容

      official grdle website

      我有: distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip

      现在我有: distributionUrl=https://services.gradle.org/distributions/gradle-6.5.1-all.zip

      screenshot

      【讨论】:

        猜你喜欢
        • 2018-05-24
        • 2018-07-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-18
        • 2016-11-18
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多