Mario Ruiz
09/16/2019, 2:38 AMansman
09/16/2019, 2:39 AM// Common
expect class Input
interface Foo {
fun doStuff(input: Input)
}
// JVM
actual typealias Input = InputStream
// Use site
object : Foo {
// I want this type to be `InputStream` when implementing this
override fun doStuff(input: Input) {
...
}
}
Konstantin Petrukhnov
09/16/2019, 9:19 AMSrSouza
09/16/2019, 1:27 PMval ktorMain by creating {
dependsOn(commonMain)
dependencies {
applyShared()
implementation("io.ktor:ktor-client-core:$ktor_version")
}
}
Someone can help me with that?jmfayard
09/16/2019, 4:15 PMlsk
09/16/2019, 4:48 PMKapil Godhwani
09/16/2019, 11:27 PM@ThreadLocal
object ServiceLocator {
lateinit var applicationContext: ApplicationContext
val CareApi by lazy { CareZoneApi(PlatformServiceLocator.httpClientEngine) }
val performLogin: PerformLogin
get() = PerformLogin(CareApi)
val loginPresenter: LoginPresenter
get() = LoginPresenter(performLogin, getUserSettings(applicationContext))
}
How do I access the applicationContext
in my iOS app code to assign it a value. The ApplicationContext is my custom class.
PS: Please let me know if this is also not the right place to ask this query.Konstantin Petrukhnov
09/17/2019, 6:48 AMJan Stoltman
09/18/2019, 8:15 AMbitcode bundle could not be generated because (...) was built without full bitcode.
when trying to build an archive of my app. Has anybody faced something like this before?darkmoon_uk
09/19/2019, 8:20 AMdarkmoon_uk
09/19/2019, 8:23 AMexpect synchronized
for now and alias it to the JVM implementation for Android, for iOS just pass through in the knowledge that its coroutines are single threaded anyway.adam-mcneilly
09/19/2019, 6:09 PM<https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20Android%20with%20Kotlin%20Multiplatform/01_Introduction>
I noticed that in this example we create a SharedCode module right inside the same folder as the Android app. Is this approach common, or is it normal to have your shared code as its own project that could be kept in its own git repository? If I do that, I'm not sure how difficult it becomes to link it to my Android app since it's no longer as simple as implementation project(':SharedCode')
. Just curious what others have done about this.louiscad
09/20/2019, 7:45 AMandroidMain
sourceSet associated with any compilation?Klara Erlebachova
09/20/2019, 9:26 AMimport platform.UIKit.UIDevice
. On Mac it's working just fine but on Linux I am getting Unresolved reference: platform
. It would be helpful to have syntax highlighting working also on Linux which is my primary platform. Any suggestions?Fail
09/20/2019, 3:13 PMLaura de la rosa
09/20/2019, 8:42 PMdarkmoon_uk
09/21/2019, 3:56 AMkotlin {
android("standardAndroid") { ... }
android("specialAndroid") { ... }
}
Get: Cannot add extension with name 'kotlinOptions', as there is an extension already registered with that name.
...is this expected?Miguel Fermin
09/21/2019, 5:57 PMandroidMain
.
ideas?Konstantin Petrukhnov
09/23/2019, 7:46 AM*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Only one Kotlin framework can be loaded currently'
*** First throw call stack:
Any suggestion how to fix it? App runs fine, only tests are failing. And tests were working before without any problem.Nikita Klimenko
09/23/2019, 1:22 PM> Task :linkMyLibReleaseFrameworkIos
e: Compilation failed: Lowering DCEPhase: phases [Devirtualization] are required, but not satisfied
I'm using these options
freeCompilerArgs += "-Xdisable-phases=Devirtualization,BuildDFG"
Bino
09/23/2019, 1:45 PMMiguel Fermin
09/23/2019, 9:34 PMiostarget
to be set to iosX64
.
val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
::iosArm64
else
::iosX64
Big Chungus
09/24/2019, 5:55 AMansman
09/25/2019, 1:37 PMUnable to find a matching variant of …The reason is that I introduced an additional build type in my project which of course doesn’t have a matching one in the MPP project. This doesn’t happen with other MPP projects. Is it because I’ve published both the
debug
and release
types of my MPP library?adam-mcneilly
09/25/2019, 3:21 PMinit()
not allowed, and I need to add all params.
So far the only work around I have is using a secondary constructor like this. It's not the worst thing but it feels kind of unnecessary:
class MyClass(
private val paramOne: Int = 5,
private val paramTwo: Int = 10
) {
constructor() : this(5, 10)
}
Kris Wong
09/25/2019, 6:02 PMiosTest
gradle task, as created by the project template, doesn't have a results file?Patrick Jackson
09/25/2019, 6:31 PMcommonMain
? Running into this in a new project with nearly identical setup & build.gradleLou Morda
09/25/2019, 7:21 PMJustin
09/25/2019, 7:41 PMspierce7
09/25/2019, 9:54 PMspierce7
09/25/2019, 9:54 PMKris Wong
09/25/2019, 9:59 PMspierce7
09/25/2019, 10:05 PM> Failed to notify project evaluation listener.
> Kotlin target 'android' tried to set up publishing for Android build variants that are not library variants or do not exist:
* release
Check the 'publishLibraryVariants' property, it should point to existing Android library variants. Publishing of application and test variants is not supported.
> Kotlin target 'android' tried to set up publishing for Android build variants that are not library variants or do not exist:
* release
Check the 'publishLibraryVariants' property, it should point to existing Android library variants. Publishing of application and test variants is not supported
adam-mcneilly
09/26/2019, 4:26 AMspierce7
09/26/2019, 4:40 AMkotlin {
android {
publishAllLibraryVariants()
}
adam-mcneilly
09/26/2019, 4:58 AMspierce7
09/26/2019, 4:59 AMlouiscad
09/26/2019, 5:42 AMspierce7
09/26/2019, 5:55 AMlouiscad
09/26/2019, 7:10 AM