Open s163404 opened 1 year ago
プロジェクト作成時点では初めて見るエラー
とりあえず検索
build.gradleの
implementation 'androidx.appcompat:appcompat:XXX'
implementation 'com.google.android.material:material:YYY'
に問題があるらしい。
直近で作ったプロジェクトのbuild.gradleに揃えれば良さそう。
ということで、https://github.com/s163404/android-basics-in-kotlin/blob/master/unit1/app/build.gradle に記載のあるバージョンに揃えた
implementation 'com.google.android.material:material:1.6.1'
'androidx.appcompat:appcompat:1.5.1' は元からバージョンがそろっていたので変更無し。
別のエラー発生
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/103d6c6af8cc27b448ff3ee1e65777ae/jetified-kotlin-stdlib-common-1.7.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
エラーの出るちょっとまえからログ抜粋 ↓
(w: から始まる行 → エラーでない、 e: から始まる行 → エラーログ)
> Task :app:processDebugResources
> Task :app:compileDebugKotlin FAILED
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/Users/kosuke/.gradle/caches/transforms-2/files-2.1/bba88c95443bb5014ba77297370d648f/jetified-kotlin-stdlib-jdk8-1.6.0.jar (version 1.6)
/Users/kosuke/.gradle/caches/transforms-2/files-2.1/41bcfda5decfed8b7fc5b6d70729616b/jetified-kotlin-stdlib-jdk7-1.6.0.jar (version 1.6)
/Users/kosuke/.gradle/caches/transforms-2/files-2.1/751af4b3b38a3affb9c7b55842887504/jetified-kotlin-stdlib-1.7.10.jar (version 1.7)
/Users/kosuke/.gradle/caches/transforms-2/files-2.1/103d6c6af8cc27b448ff3ee1e65777ae/jetified-kotlin-stdlib-common-1.7.10.jar (version 1.7)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/103d6c6af8cc27b448ff3ee1e65777ae/jetified-kotlin-stdlib-common-1.7.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/32456468d345f628173d48e120cf605f/jetified-lifecycle-viewmodel-savedstate-2.5.1-api.jar!/META-INF/lifecycle-viewmodel-savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/41bcfda5decfed8b7fc5b6d70729616b/jetified-kotlin-stdlib-jdk7-1.6.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/4b959ae40f1d1237f86543c874f6605c/jetified-kotlinx-coroutines-core-jvm-1.6.1.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/5a0cb5d3afa66df9bd6c8c8f6527bd43/jetified-activity-1.5.1-api.jar!/META-INF/activity_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/751af4b3b38a3affb9c7b55842887504/jetified-kotlin-stdlib-1.7.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/7dd77d8c38b8820cc26126273c2533ca/jetified-core-ktx-1.9.0-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/7eddf22464501c29a611acae091496bb/core-1.9.0-api.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/99fb048b11cd041668ffcebd9482e82b/jetified-annotation-experimental-1.3.0-api.jar!/META-INF/annotation-experimental_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/bba88c95443bb5014ba77297370d648f/jetified-kotlin-stdlib-jdk8-1.6.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/bd1cfc6707e8657fc1c4fa6e2123fa3b/jetified-savedstate-1.2.0-api.jar!/META-INF/savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/e5a8b62e5cb91ea7a4d63f0ee326c98e/appcompat-1.5.1-api.jar!/META-INF/appcompat_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/e901dee7bdff9450ab4aa87700bc96b1/lifecycle-viewmodel-2.5.1-api.jar!/META-INF/lifecycle-viewmodel_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/.gradle/caches/transforms-2/files-2.1/ea2d1a2aeaec7ff4bf66d748ee2fba08/jetified-kotlinx-coroutines-android-1.6.1.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
e: /Users/kosuke/AndroidStudioProjects/android-basics-in-kotlin/unit1-pathway4/app/src/main/java/com/example/diceroller/MainActivity.kt: (8, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
The class is loaded from /Users/kosuke/.gradle/caches/transforms-2/files-2.1/751af4b3b38a3affb9c7b55842887504/jetified-kotlin-stdlib-1.7.10.jar!/kotlin/Unit.class
e: /Users/kosuke/AndroidStudioProjects/android-basics-in-kotlin/unit1-pathway4/app/src/main/java/com/example/diceroller/MainActivity.kt: (9, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2.
The class is loaded from /Users/kosuke/.gradle/caches/transforms-2/files-2.1/751af4b3b38a3affb9c7b55842887504/jetified-kotlin-stdlib-1.7.10.jar!/kotlin/Unit.class
> Task :app:mergeExtDexDebug
FAILURE: Build failed with an exception.
ログ読み取る
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
「クラスパスに見つかったJARのランタイムは同じバージョンになっているべき。」
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
いくつかのJARのランタイムはバージョンが違ってるよ。 クラスパスからの消去を検討して。
指定のバージョンと実際のバージョンの食い違い。ということで直近で作った別のAndroidProjectとkotlinバージョンを揃える。
指定のバージョンと実際のバージョンの食い違い。ということで直近で作った別のAndroidProjectとkotlinバージョンを揃える。
https://github.com/s163404/android-basics-in-kotlin/commit/18dd4905d1b7062b509642f6906a11b0b068f4f2
の通り、 Kotlin バージョンを 1.6.0
に変更していた。これに揃える。
ビルド成功
BUILD SUCCESSFUL in 19s
26 actionable tasks: 26 executed
Build Analyzer results available
エラー