Composeを1.0.1から1.0.5にアップする
buildscript { ext { compose_version = ‘1.0.5’ <=ここ //kotlin_version = ‘1.5.31’ }
repositories { google() mavenCentral() } dependencies { classpath “com.android.tools.build:gradle:7.0.4” //classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21” classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31” <=ここ
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
同時にKotlinのバージョンを1.5.31に挙げるひつようあり
composeOptions { kotlinCompilerExtensionVersion compose_version //kotlinCompilerVersion ‘1.5.21’ <=ここは消す
}
または、(Jetnews sampleより)
buildscript { ext.kotlin_version = ‘1.6.10’ <= ext.compose_version = ‘1.1.0-rc01’ <= ext.coroutines_version = ‘1.5.2’ ext.accompanist_version = ‘0.22.0-rc’
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" <=
}
} として composeOptions { kotlinCompilerExtensionVersion ‘1.1.0-rc02’ // For Kotlin 1.6.10. Revert with rc03 }
dependencies { implementation “org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version” implementation “org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version”
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.animation:animation:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "com.google.accompanist:accompanist-swiperefresh:$accompanist_version"
implementation "com.google.accompanist:accompanist-insets:$accompanist_version"
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.activity:activity-compose:1.4.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0"
implementation 'androidx.navigation:navigation-compose:2.4.0-rc01'
implementation "androidx.window:window:1.0.0-rc01"
androidTestImplementation 'androidx.test:core:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation "androidx.compose.ui:ui-test:$compose_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
// Robolectric dependencies
testImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
// TODO: Bump to 4.6.* after https://github.com/robolectric/robolectric/issues/6593 is fixed
testImplementation 'org.robolectric:robolectric:4.5.1'
}
https://developer.android.com/jetpack/androidx/releases/compose
composeとKotlinのバージョン対応表 https://developer.android.com/jetpack/androidx/releases/compose-kotlin