Skip to content

Commit

Permalink
fix: shared-android.gradle.kts red in AS Chipmunk
Browse files Browse the repository at this point in the history
When updating to Android Studio Chimpmunk, after removing all build directories, the `android` section of `shared-android.gradle.kts` was unrecoginized.

I found and applied this fix:
Gurupreet/ComposeCookBook#112 (comment)

In the process of testing this, I discovered that AS was launching both Intel and M1 java processes. Turned out that the 1.8 java processes were Intel, so I switched all `kotlin.jvmTargets` to 11 to avoid this.
  • Loading branch information
humblehacker committed May 11, 2022
1 parent 507d8f7 commit 06bb405
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ allprojects {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.FlowPreview"

kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "11"
}

project.version = "0.1.0"
Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/shared-android.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ android {

@Suppress("UnstableApiUsage")
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}

Expand Down

0 comments on commit 06bb405

Please sign in to comment.