gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 12:55:59 34 4
gpt4 key购买 nike

这是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 plugin version (4.0.1) & gradle version (6.5.1)
我也无法打开"file"->“设置”,单击它,但没有打开任何窗口。
我尝试过“为项目配置Kotlin”,但说没有可用的配置器。
我已经尝试过重建,清理,失效并重新启动。
我已经尝试过许多关于stackoverflow的解决方案,但是都没有成功。
我仍然有Kotlin未配置的问题,任何帮助将不胜感激。

最佳答案

使用kotlin lang创建一个新 Activity ,它将自动配置kotlin

关于android - 更新Android Studio和Gradle插件后未配置Kotlin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62957540/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com