-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Compose version to latest stable version #956
Comments
Updating the version of Jetpack Compose in the Android Architecture Components samples requires modifying the project’s Steps to Update Jetpack Compose Version
// build.gradle (Project-level)
buildscript {
ext {
compose_version = '1.4.0' // Update to the latest stable version
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0' // Ensure this is up-to-date
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" // Ensure this matches the latest Compose version requirements
}
}
// build.gradle (App-level)
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 31
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "androidx.core:core-ktx:1.7.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.10"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
implementation "androidx.activity:activity-compose:1.4.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
}
Example Pull Request (PR) UpdateIf you’re submitting a pull request to update the Compose version, you might include the following message in your PR description: PR Title: Update Compose version to latest stable version Description: This PR updates the Jetpack Compose version to the latest stable version
Apply these changes and test thoroughly to ensure that the project functions correctly with the latest Compose version. |
No description provided.
The text was updated successfully, but these errors were encountered: