Djuro
01/12/2024, 1:33 PMbuild.gradle.kts
,
I had to add
sourceSets {
androidMain {
dependencies {
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.ktor.client.android)
implementation(libs.decompose)
}
dependsOn(commonMain.get()) ----> this line
}
dependsOn(commonMain.get())
line for example, why?
Also in iOS, I had change isStatic = false
instead of true
which was there by default. What does this change for me?
I also added
"$SRCROOT/../gradlew" -p "$SRCROOT/../" :yourframeworkproject:copyFrameworkResourcesToApp \
-Pmoko.resources.PLATFORM_NAME="$PLATFORM_NAME" \
-Pmoko.resources.CONFIGURATION="$CONFIGURATION" \
-Pmoko.resources.ARCHS="$ARCHS" \
-Pmoko.resources.BUILT_PRODUCTS_DIR="$BUILT_PRODUCTS_DIR" \
-Pmoko.resources.CONTENTS_FOLDER_PATH="$CONTENTS_FOLDER_PATH"
My main issue was that isStatic
field was set to false
Also, I had to add following code to KotlinMultiplatformExtension
kotlin {
applyDefaultHierarchyTemplate()
}
Isn't there any simpler way to perform all of this? Am I doing something wrong or is it supposed to be like thisalex009
01/15/2024, 3:36 AMit's workaround to support kotlin 1.9 with resources 0.23. in 0.24 it's not required.line for example, why?dependsOn(commonMain.get())
Also in iOS, I had changecompose multiplatform in past requireinstead ofisStatic = false
which was there by default. What does this change for me?true
isStatic = true
. at latest CM versions it's not requirement so you can disable static.
this call should be used only when you useCopy codecopyFrameworkResourcesToApp
isStatic = true
. because static frameworks can't have own resources.Djuro
01/17/2024, 5:54 PMdependsOn(commonMain.get())
Regarding iOS limitations, well I'll just let them be 😄Djuro
01/17/2024, 6:43 PMsourceSets {
val iosSimulatorArm64Main by getting {
dependsOn(commonMain.get())
}
}
Otherwise, I would be getting an error
MR.kt:7:22: error: Expected object 'MR' has no actual declaration in module <AppName:composeApp> for Native
error: Compilation finished with errors
Is this expected behaviour?alex009
01/18/2024, 7:22 AMDjuro
01/18/2024, 7:29 AMDjuro
01/20/2024, 1:34 PM