Open8

Compose Multiplatform

hiraokhiraok

以下のエラーが出力される

Caused by: com.android.builder.errors.EvalIssueException: Failed to install the following Android SDK packages as some licences have not been accepted.
   build-tools;33.0.1 Android SDK Build-Tools 33.0.1
   platforms;android-34 Android SDK Platform 34
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
All licenses can be accepted using the sdkmanager command line tool:
sdkmanager.bat --licenses
Or, to transfer the license agreements from one workstation to another, see https://developer.android.com/studio/intro/update.html#download-with-gradle
hiraokhiraok

対応方法

歯車マークを押下して、Android SDK Managerを開く

Editを開く

Nextを押して進めていく

hiraokhiraok

kotlin-wasmをprojectに入れているとcommonMainktor-client-coreを入れるとエラーが出る

No matching variant of io.ktor:ktor-client-core:2.3.7 was found

ktorのversionがkotlin-wasmプラットフォームに対応していないのが原因
wasmJsをbuild.gradleから取り除くことで解決

hiraokhiraok

一旦build.gradleは以下のように設定

sourceSets {
        androidMain.dependencies {
            implementation(libs.ktor.client.okhttp)
        }
        commonMain.dependencies {
            implementation(libs.ktor.client.core)
        }
        iosMain.dependencies {
            implementation(libs.ktor.client.darwin)
        }
}