Laurence Muller
11/23/2021, 10:28 PMval iosMain by getting is now replaced by val iosMain by creating and using
{
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
//iosSimulatorArm64Main.dependsOn(this)
}
With iosX64Main and iosArm64Main being split up to its own val .
Does this mean I should be adding the dependencies for both (basically just copy them over in both sections)? For some reason, Android studio doesnt want to resolve the correct driver (for sqldelight in my case). See screenshots in the 🧵 .Laurence Muller
11/23/2021, 10:28 PMLaurence Muller
11/23/2021, 10:31 PMiosMain folder)Laurence Muller
11/23/2021, 10:44 PMLaurence Muller
11/24/2021, 1:57 AMiosX64Main and iosArm64Main and ignoring any implementation in iosMain) but unsure if that's the right way to do this.Laurence Muller
11/24/2021, 2:11 AM> Task :shared:compileKotlinIosX64 FAILED
e: /Users/lalala/TestKMM/shared/src/commonMain/kotlin/com/epicwill/testkmm/Platform.kt: (3, 14): Class 'Platform' has several compatible actual declarations in modules <TestKMM:shared>, <TestKMM:shared>
e: /Users/lalala/TestKMM/shared/src/commonMain/kotlin/com/epicwill/testkmm/Platform.kt: (3, 14): Redeclaration: Platform
e: /Users/lalala/TestKMM/shared/src/commonMain/kotlin/com/epicwill/testkmm/Platform.kt: (3, 22): Constructor of 'Platform' has several compatible actual declarations in modules <TestKMM:shared>, <TestKMM:shared>
e: /Users/lalala/TestKMM/shared/src/commonMain/kotlin/com/epicwill/testkmm/Platform.kt: (4, 9): Property 'platform' has several compatible actual declarations in modules <TestKMM:shared>, <TestKMM:shared>
e: /Users/lalala/TestKMM/shared/src/iosMain/kotlin/com/epicwill/testkmm/Platform.kt: (5, 14): Redeclaration: Platform
e: /Users/lalala/TestKMM/shared/src/iosX64Main/kotlin/com/epicwill/testkmm/Platform.kt: (5, 14): Redeclaration: Platform
I guess iosMain isn't smart enought to ignore one of the Platform implementationsLaurence Muller
11/24/2021, 2:12 AMLaurence Muller
11/24/2021, 2:12 AMiosArm64Main and iosX64Main are the same so this feels wrong to meTijl
11/24/2021, 9:44 AMArtyom Degtyarev [JB]
11/24/2021, 10:24 AMios target shortcut(link).
Instead, it does the same thing but manually - declares several ios targets and an intermediate source set being a common between them.
This should not stop you from setting the dependencies inside iosMain block, and using them inside your code located at src/iosMain/kotlin...
In your case, you made a step back from the hierarchical Multiplatform approach. Put the code into a single iosMain, get rid of your ios<Arm/X>64Main s and try again please.Laurence Muller
11/24/2021, 11:54 AMval iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
//iosSimulatorArm64Main.dependsOn(this)
dependencies {
implementation("com.squareup.sqldelight:native-driver:$sqlDelightVersion")
}
}