実現したいこと
Udemyの【Android開発/2023年版】3つのアプリを作りながらJetpack Composeでのアプリ開発の基礎をマスターコースを受講しています。
こちらのコースは、Androidstudioのバージョンにelectric eelを推奨しているため、electric eelでコースを最後まで受講したあとに
現在の最新バージョンIguanaで再受講を試みています。
バージョンの違いのためか、コンパイルエラー等が起きているのでエラーを解消したいのですが
一人では行き詰ってしまったためお力添えをいただきたいです。
発生している問題・分からないこと
ライブラリのkotlinのバージョンが互換性がないよエラーが発生したため、
composeバージョンをあげた後にsyncをするとエラーが発生しました。
バージョンはCompose to Kotlin Compatibility Map以下のバージョンを記述
Compose バージョン Kotlin バージョン
1.2.0 1.7.0
現在の最新環境とは古いとは思いますが、どれが適切かがわからないため
動画で使用していたのもそのまま記述しました。
エラーメッセージ
error
1Unresolved reference: packaging 2 3以下、ソースコードにコメント // ★で、該当行を記載しています。
該当のソースコード
kotlin
1plugins { 2 id("com.android.application") 3 id("org.jetbrains.kotlin.android") 4 id("kotlin-kapt") 5} 6 7android { 8 namespace = "com.example.todoapp" 9 compileSdk = 34 10 11 defaultConfig { 12 applicationId = "com.example.todoapp" 13 minSdk = 24 14 targetSdk = 34 15 versionCode = 1 16 versionName = "1.0" 17 18 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 19 vectorDrawables { 20 useSupportLibrary = true 21 } 22 } 23 24 buildTypes { 25 release { 26 isMinifyEnabled = false 27 proguardFiles( 28 getDefaultProguardFile("proguard-android-optimize.txt"), 29 "proguard-rules.pro" 30 ) 31 } 32 } 33 compileOptions { 34 sourceCompatibility = JavaVersion.VERSION_1_8 35 targetCompatibility = JavaVersion.VERSION_1_8 36 } 37 kotlinOptions { 38 jvmTarget = "1.8" 39 } 40 buildFeatures { 41 compose = true 42 } 43 composeOptions { 44 kotlinCompilerExtensionVersion = "1.5.1" 45 } 46 packaging { // ★こちらの行を指してエラーが発生しています 47 resources { 48 excludes += "/META-INF/{AL2.0,LGPL2.1}" 49 } 50 } 51} 52 53dependencies { 54 55 implementation(libs.androidx.core.ktx) 56 implementation(libs.androidx.lifecycle.runtime.ktx) 57 implementation(libs.androidx.activity.compose) 58 implementation(platform(libs.androidx.compose.bom)) 59 implementation(libs.androidx.ui) 60 implementation(libs.androidx.ui.graphics) 61 implementation(libs.androidx.ui.tooling.preview) 62 implementation(libs.androidx.material3) 63 testImplementation(libs.junit) 64 androidTestImplementation(libs.androidx.junit) 65 androidTestImplementation(libs.androidx.espresso.core) 66 androidTestImplementation(platform(libs.androidx.compose.bom)) 67 androidTestImplementation(libs.androidx.ui.test.junit4) 68 debugImplementation(libs.androidx.ui.tooling) 69 debugImplementation(libs.androidx.ui.test.manifest) 70 val room_version = "2.6.1" 71 implementation("androidx.room:room-runtime:$room_version") 72 annotationProcessor("androidx.room:room-compiler:$room_version") 73 kapt("androidx.room:room-compiler:$room_version") 74 implementation("androidx.room:room-ktx:$room_version") 75}
kotlin
1// Top-level build file where you can add configuration options common to all sub-projects/modules. 2plugins { 3 id("com.android.application") version "7.2.2" 4 id("org.jetbrains.kotlin.android") version "1.7.0" 5}
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
Google検索では解消できるようなリソースを見つけられませんでした。
electric eelとIguana書き方も異なるので混乱しています。
技術初心者です。
補足
特になし
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。