更新Android Studio和Gradle插件后未配置Kotlin

卡什1

这是build.gradle项目文件:

buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}
allprojects {
    repositories {
        google()
        jcenter()
    }
}
repositories {
    mavenCentral()
}
compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}
compileTestKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

这是build.gradle应用程序文件:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-kapt'

apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "ze.app.xyzmath"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 2
        versionName "2.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding { enabled = true }
}

dependencies {
    def nav_version = "2.3.0"
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.gms:play-services-ads:17.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-auth:19.3.1'
    implementation 'com.google.android.gms:play-services-auth:18.0.0'
    implementation 'com.google.firebase:firebase-common-ktx:19.3.0'
    implementation "com.android.support:support-compat:28.0.0"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.fragment:fragment-ktx:1.2.5'
    implementation 'com.opencsv:opencsv:4.6'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.room:room-runtime:2.2.5'
    annotationProcessor 'androidx.room:room-compiler:2.2.5'
    implementation 'com.google.android.gms:play-services-games:19.0.0'
    implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0'
    implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0'
    implementation 'com.google.android.gms:play-services-auth:18.0.0'
}

Android Gradle插件版本(4.0.1)和Gradle版本(6.5.1)

我也无法打开“文件”->“设置”,单击它,但没有打开任何窗口。

我尝试过“为项目配置Kotlin”,但说没有可用的配置器。

我已经尝试过重建,清理,失效并重新启动。

我已经尝试过许多关于stackoverflow的解决方案,但是都没有成功。

我仍然有Kotlin未配置的问题,任何帮助将不胜感激。

卡什1

解决-删除C:\ Users \ YourUserName中的.AndroidStudio4.0目录

Android Studio会自动创建一个新的,没有问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在 android studio 中更新 kotlin 插件后 Flutter 构建失败

Gradle和插件更新使Android Studio中出现错误

禁用Dart和Kotlin插件后,Android Studio无法运行

更新至Android Studio 3.0。出现“未配置Kotlin”错误

更新 Android Studio 和 Gradle 后,Gradle 项目同步失败

Android Studio更新后,Android Gradle CompilationFailedException

更新android studio后gradle同步失败

在Android Studio中更新android项目后,我的gradle构建未运行

无法更新Android Gradle插件

Kotlin插件更新后,Gradle项目同步失败

更新到android gradle插件3.5后的proguard问题

更新android gradle插件后无法构建发布APK

无法更新到Android Studio Gradle 1.4插件

将Gradle和Android Studio更新为3.5后,复制Hamcrest和JUnit类

更新Android Studio 2.1后出现插件错误

Android Studio,Gradle更新错误

配置Kotlin插件更新失败?

更新后,android studio 报错

Android Studio-平台和插件更新以及Java @ OSX

将Android Studio更新到1.5后出现Gradle错误

更新到9.4.0后,Android Studio Gradle错误

将Android Studio更新到3.1.2后,Gradle构建失败

Android Studio更新后不支持Gradle版本

gradle Android Studio更新后链接引用失败

Android Studio更新后:未找到Gradle DSL方法:“ runProguard()”

Gradle同步失败-将Android Studio更新为3.2后

更新Gradle(Android Studio 3.0)后,LibGdx无法正常工作

Android Studio更新后Gradle无法合并dex

更新Android Studio版本后,Gradle同步失败