注:このプロジェクトにアタッチされている一部の Kotlin ライブラリは、新しい Kotlin コンパイラでコンパイルされているため、
前書き: この問題が発生したときに質問を始めたところ、kotlin のバージョンがアップグレードされたという人、Android Studio のバージョンがアップグレードされたという人、.gradle を削除したという人がいました。しかし、AS では Kotlin が最新であると表示され、それをアップグレードする方法がありません。AS 4.2.2 の使用には慣れているのでアップグレードしたくありません。.gradle フォルダーを確認したところ、サイズが数ギガバイトなので、この問題を引き起こしたくないのですが、他にも問題があったため、自分で問題の他の解決策を模索し始めました。
状況説明
新しい Kotlin デモを作成し、上記の状況を報告し始めましたが、プラグインのバージョンに応じて 1 つずつ設定していたのですが、この問題が表示され、後から No update found が表示されました。
私のkotlinバージョンは1.5.31、ASバージョンは4.2.2なので問題ないようですが、
他のアプリのbuild.gradleは以下の通りです
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.demo.kotlindemo"
minSdkVersion 27
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
そこで、androidTest の該当内容は使用しないだろうと思い、削除して再コンパイルしたところ、問題は解消されました。
アプリの build.gradle は関連する紹介文を削除しました