Cristián Arenas
01/03/2020, 2:00 PMunresolved reference: platform on Android Studio in my iosMain files, unless I add this:
iosX64Main {
…
kotlin.srcDirs += project.file("src/iosMain/kotlin")
}
iosArm64Main {
…
kotlin.srcDirs += project.file("src/iosMain/kotlin")
}
(I can generate the library though, so it seems the problem is with Android Studio)
But if I add that, then it starts expecting new actuals: expected class 'X' has no actual declaration in module my-app_iosX64Main for NativeKris Wong
01/03/2020, 2:02 PMCristián Arenas
01/03/2020, 2:13 PMiosX64('ios')Cristián Arenas
01/03/2020, 2:24 PMios should be creating targets for iosArm64 and iosX64 and that I should create an intermediate source set (iosMain) and configuring links between it and the platform source sets.
While here it seems I’m changing the name of the iosX64 target to ios and using that as a base to build iosArm64, which sounds wrong… as I have different dependencies for both targetsErik Christensen
01/03/2020, 2:26 PMCristián Arenas
01/03/2020, 2:27 PMKris Wong
01/03/2020, 2:28 PMKris Wong
01/03/2020, 2:28 PMCristián Arenas
01/03/2020, 2:29 PMKris Wong
01/03/2020, 2:29 PMKris Wong
01/03/2020, 2:29 PMCristián Arenas
01/03/2020, 2:30 PMCristián Arenas
01/03/2020, 2:32 PMiosX64 to ios not mess up my dependencies?
I have most dependencies on iosMain, but then iosX64Main and iosArm64Main (each dependsOn iosMain) add some extra architecture-specific dependenciesErik Christensen
01/03/2020, 2:33 PMCristián Arenas
01/03/2020, 2:33 PMiosMain change if I rename iosX64 to ios?Erik Christensen
01/03/2020, 2:34 PMiosMain becomes the target's source set rather than a shared source set between targets when you do thatCristián Arenas
01/03/2020, 2:35 PMCristián Arenas
01/03/2020, 2:36 PMyou can check for a Gradle property that indicates that IDEA is active and setup your targets so as to avoid having a shared source set just in that contextHow do you do that? where can I read more about it?
Erik Christensen
01/03/2020, 2:37 PMErik Christensen
01/03/2020, 2:38 PMCristián Arenas
01/03/2020, 2:38 PMCristián Arenas
01/03/2020, 2:39 PMideaActive be true if I launch a gradle task from Android Studio?Cristián Arenas
01/03/2020, 2:40 PMErik Christensen
01/03/2020, 2:42 PMCristián Arenas
01/03/2020, 2:43 PMCristián Arenas
01/03/2020, 2:44 PMCristián Arenas
01/03/2020, 2:44 PMErik Christensen
01/03/2020, 2:45 PMCristián Arenas
01/03/2020, 2:48 PM// You may uncomment this line for autocompletion to work on Android Studio
//iosX64('ios') // DO NOT COMMIT THIS UNCOMMENTED LINECristián Arenas
01/03/2020, 2:48 PMKris Wong
01/03/2020, 2:48 PMKris Wong
01/03/2020, 2:49 PMiosMain as the target's source set?Cristián Arenas
01/03/2020, 2:51 PMI have most dependencies on iosMain, but then iosX64Main and iosArm64Main (each dependsOn iosMain) add some extra architecture-specific dependenciesSo if Erik’s statement is true:
iosMain becomes the target’s source set rather than a shared source set between targets when you do thatThat would mean that iosArm64 could contain iosX64 specific code
Cristián Arenas
01/03/2020, 2:52 PMCristián Arenas
01/03/2020, 2:54 PMCristián Arenas
01/03/2020, 2:56 PMKris Wong
01/03/2020, 2:58 PMKris Wong
01/03/2020, 2:58 PMKris Wong
01/03/2020, 2:59 PMiosX64("ios") {
compilations {
"main" {
dependencies {
implementation("suparnatural-kotlin-multiplatform:fs-iosx64:$suparnaturalVersion")
}
}
}
}
iosArm64 {
compilations {
"main" {
dependencies {
implementation("suparnatural-kotlin-multiplatform:fs-iosarm64:$suparnaturalVersion")
}
}
}
compilations["main"].defaultSourceSet {
dependsOn(sourceSets["iosMain"])
}
}Kris Wong
01/03/2020, 2:59 PMKris Wong
01/03/2020, 3:00 PMCristián Arenas
01/03/2020, 3:01 PMKurt Renzo Acosta
01/05/2020, 11:09 PM