gpt4 book ai didi

android - Gradle同步失败:无法初始化类org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt

转载 作者:行者123 更新时间:2023-12-03 04:54:50 28 4
gpt4 key购买 nike

21:10   Gradle sync failed: Could not initialize class org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt
Consult IDE log for more details (Help | Show Log) (7s 78ms)

嗨,大家好,我尝试过使缓存无效并重新启动,用gradle和文件系统同步项目,更新最新的稳定的kotlin,创建新项目,然后让android studio下载所有更新,并且仍然遇到此错误。谁能帮我 ?对不起,我真的是android中的新手

这是我的= app / build.gradle
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
defaultConfig {
applicationId "com.asusx.rogmode.rog"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:29'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

gradle-wrapper.properties
#Wed Jun 10 20:24:06 ICT 2020
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

我将Android Studio从3.5更新到4.0时遇到了同样的问题。
我将ext.kotlin_version更改为1.3.72,然后运行了构建。这解决了问题。
该链接给了我提示:https://kotlinlang.org/docs/reference/using-gradle.html

关于android - Gradle同步失败:无法初始化类org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62306826/

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