Elad Finish
07/07/2023, 11:22 AMkotlin.version=1.8.20
compose.version=1.4.1
I can run iOS app, but on running Android app, the build fails:
> Task :androidApp:compileDevDebugKotlin FAILED
e: This version (1.4.1) of the Compose Compiler requires Kotlin version 1.8.0 but you appear to be using Kotlin version 1.8.20 which is not known to be compatible. Please consult the Compose-Kotlin compatibility map located at <https://developer.android.com/jetpack/androidx/releases/compose-kotlin> to choose a compatible version pair (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
So I changed Kotlin version to 1.8.0 and it solved the issue for Android, but then iOS has an issue: (full details in comment)
> Task :composables:linkPodDebugFrameworkIosSimulatorArm64 FAILED
e: Module "org.jetbrains.compose.ui:ui (org.jetbrains.compose.ui:ui-uikitsimarm64)" has a reference to symbol platform.UIKit/UIView.setFrame|-3257539694696545905[100]. Neither the module itself nor its dependencies contain such declaration.
This could happen if the required dependency is missing in the project. Or if there is a dependency of "org.jetbrains.compose.ui:ui (org.jetbrains.compose.ui:ui-uikitsimarm64)" that has a different version in the project than the version that "org.jetbrains.compose.ui:ui (org.jetbrains.compose.ui:ui-uikitsimarm64): 1.4.1" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.
Any help would be appreciated!Elad Finish
07/07/2023, 11:23 AMJohn O'Reilly
07/07/2023, 12:33 PMkotlinCompilerPluginArgs
setting....see example in following file
https://github.com/joreilly/PeopleInSpace/blob/main/compose-ios/build.gradle.ktsJohn O'Reilly
07/07/2023, 12:38 PMJohn O'Reilly
07/07/2023, 12:39 PM1.4.5
in for Kotlin 1.8.20
Elad Finish
07/07/2023, 2:00 PM* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.jetbrains.compose', version: '1.4.5'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.compose:org.jetbrains.compose.gradle.plugin:1.4.5')
Searched in the following repositories:
Gradle Central Plugin Repository
maven(<https://maven.pkg.jetbrains.space/public/p/compose/dev>)
Google
John O'Reilly
07/07/2023, 2:11 PMJohn O'Reilly
07/07/2023, 2:12 PMJohn O'Reilly
07/07/2023, 2:17 PMJohn O'Reilly
07/07/2023, 2:17 PMJohn O'Reilly
07/07/2023, 2:19 PMJohn O'Reilly
07/07/2023, 2:20 PMElad Finish
07/07/2023, 2:20 PMwhich module is above complaining about?
Build file '/Users/eladfinish/AndroidStudioProjects/elad/BibleContestMobileApp/composables/build.gradle.kts' line: 1
Plugin [id: 'org.jetbrains.compose', version: '1.4.5'] was not found in any of the following sources:
Elad Finish
07/07/2023, 2:20 PMJohn O'Reilly
07/07/2023, 2:20 PMJohn O'Reilly
07/07/2023, 2:21 PMJohn O'Reilly
07/07/2023, 2:21 PMElad Finish
07/07/2023, 2:23 PMJohn O'Reilly
07/07/2023, 2:26 PMcompose {
kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.8.20")
}
John O'Reilly
07/07/2023, 2:27 PMElad Finish
07/07/2023, 2:34 PMkotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += listOf(
"-Xallow-jvm-ir-dependencies",
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=1.8.20",
)
}
trying on iosJohn O'Reilly
07/07/2023, 2:36 PMcompose
section like I have above for your ios module (as per https://github.com/JetBrains/compose-multiplatform/blob/master/VERSIONING.md)John O'Reilly
07/07/2023, 2:37 PMElad Finish
07/07/2023, 2:41 PMbuild.gradle.kts
file
and I did manage to run the app on ios simulatorJohn O'Reilly
07/07/2023, 2:45 PMJohn O'Reilly
07/07/2023, 2:46 PMiosMain
code in shared module?Elad Finish
07/07/2023, 2:56 PMcomposables
)Elad Finish
07/07/2023, 2:59 PMRootViewController.kt
resides in
composables/src/iosMain/kotlin/com/eladfinish/bible/contest/composables/RootViewController.kt
^John O'Reilly
07/07/2023, 3:18 PMbuild.gradle.kt
in the composeables
module that you need to update by adding something like following
compose {
kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.8.20")
}
Elad Finish
07/09/2023, 9:51 AM