Djuro
02/22/2024, 9:03 AM1.6.0-beta01
It is working fine on Android, but is causing issue for iOS devices.
I think it might started happening when I started using sqldelight maybe 🤔 but I am not sure honestly.
here is my build.gradle.kts
is in the 🧵
Issue I am getting when updating to a new version is the following
Error I am getting is in this stacktrace
I was recommended to download and use the new kmp wizard version but the project is too large atm in my opinion for doing that. Could someone tell what could new kmp wizard change so I could somehow migrate 🤔Djuro
02/22/2024, 9:04 AMbuild.gradle.kts
import org.jetbrains.compose.ExperimentalComposeLibrary
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.gradle.buildconfig.plugin)
alias(libs.plugins.kotlinSerilization)
alias(libs.plugins.sqldelight)
id("dev.icerock.mobile.multiplatform-resources")
}
repositories {
google()
mavenCentral()
}
kotlin {
applyDefaultHierarchyTemplate()
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
linkerOpts.add("-lsqlite3") // not needed but I remember it being needed before
baseName = "ComposeApp"
isStatic = false // THIS HAD TO BE CHANGED FOR SQLDELIGHT TO WORK
// isStatic = true // this had to be changed for MOKO-RESOURCES to work
}
}
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)
implementation(libs.sqldelight.android)
implementation(libs.koin.android)
}
iosMain.dependencies {
implementation(libs.ktor.client.darwin)
implementation(libs.sqldelight.native)
}
// val iosSimulatorArm64Main by getting {
// dependsOn(commonMain.get())
// }
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
@OptIn(ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
implementation(libs.kotlinx.datetime)
implementation(libs.bundles.ktor)
implementation(libs.kotlinx.serialization)
implementation(libs.ktor.client.logging)
implementation(libs.ktor.client.auth)
implementation(libs.kermit)
implementation(libs.moko.resources)
implementation(libs.moko.resources.compose)
implementation(libs.multiplatform.settings)
implementation(libs.multiplatform.settings.noarg)
implementation(libs.decompose)
implementation(libs.decompose.compose)
implementation(libs.kamel)
implementation(libs.compose.fontawesome.icons)
implementation(libs.koin.core)
implementation(libs.kotlinx.immutable.collections)
implementation(libs.sqldelight.coroutines)
}
}
}
android {
namespace = "?"
compileSdk = libs.versions.android.compileSdk.get().toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
defaultConfig {
applicationId = "?"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
debugImplementation(libs.compose.ui.tooling)
}
}
multiplatformResources {
resourcesPackage.set("?")
}
buildConfig {
buildConfigField(
"String",
"BASE_URL",
"\"???""
)
}
sqldelight {
databases {
create("LunchBreakDatabase") {
packageName.set("org.example.lunchbreak")
}
}
}
Dima Avdeev
02/22/2024, 10:00 AMDima Avdeev
02/22/2024, 10:09 AMDjuro
02/22/2024, 12:28 PMrc02
version, is there some stacktrace or similar I can provide that would be of help?Djuro
02/22/2024, 12:28 PMDjuro
02/22/2024, 1:35 PMDima Avdeev
02/22/2024, 11:33 PMComposeUIViewController {
Text("Hello World")
}
• If error will be still presented - it is good for current step
• Next, try to partially remove dependencies from build.gradle files.
I hope in some step your project will compile and we can understand that's really brokes your build.Djuro
02/23/2024, 10:35 AMDjuro
02/23/2024, 10:35 AMDjuro
02/23/2024, 10:53 AMDjuro
02/23/2024, 11:05 AM@OptIn(ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
Why and how I am really not sure.
Do you maybe know why this would happen? Even if compose resources are transitively available in 1.6.0-rc02
, can it affect this?
Anyways, removing explicit dependency fixes the issue.
Also, just want to point out that compose.components.resources
is not coming from my .toml
file (or any versioning system) but rather from org.jetbrains.compose
gradle pluginDjuro
02/23/2024, 11:05 AMDima Avdeev
02/23/2024, 12:20 PMDima Avdeev
02/23/2024, 12:23 PMDjuro
02/23/2024, 1:15 PM