Kris Wong
01/02/2020, 3:09 PMTristan
01/02/2020, 3:53 PMKris Wong
01/02/2020, 5:46 PMBuildConfig
for Android? I haven't seen anything.Kris Wong
01/02/2020, 5:53 PMcommonTest
, even though they are for commonMain
. it doesn't handle source set dependencies properly.kzotin
01/02/2020, 6:38 PMFlow
in MPP/KN modules? Got any tips & tricks?
I'm trying to expose shared repository layer for iOS/Android, and considering which Observable
implementation to expose. Would really like to avoid Reaktive
, having already coroutines and RxJava in the project...
Thanks in advance!dambakk
01/03/2020, 8:16 AMunresolved reference
error when trying to import the dependencies. Android Studio says everything is fine, and I can even inspect the source by cmd+clicking, but when building the project the errors starts appearing. Now it’s Kissme I’m trying to import. I’ve put the implementation
in all source sets (including test, just in case) with the corresponding suffix. I don’t know what else to do. Any suggestions?mzgreen
01/03/2020, 9:54 AMUIView
and override this function: https://developer.apple.com/documentation/uikit/uiview/1622529-draw but I don’t see it in Kotlin, what may be the reason?Big Chungus
01/03/2020, 10:44 AMexpect val platform:String
?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 Native
Samuel Michael
01/03/2020, 4:46 PMHannes
01/03/2020, 6:45 PMcommonTest
. In my build.gradle
i have the following config:
kotlin {
...
sourceSets {
...
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-common'
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
}
}
}
}
However, if I run a test in src/commonTest/kotlin/my/package/FooTest.kt
which looks like this
import kotlin.test.Test
import kotlin.test.assertEquals
class FooTest {
@Test
fun filterState(){
assertEquals(1, 2)
}
}
I get
Unresolved reference: Test
e: ... /src/commonTest/kotlin/my/package/FooTest.kt: (3, 20): Unresolved reference: Test
e: ... /src/commonTest/kotlin/my/package/FooTest.kt: (4, 20): Unresolved reference: assertEqualsAny idea what I have misconfigured?
René
01/04/2020, 3:03 PMNick Halase
01/04/2020, 7:47 PMcore.symlinks
to for my project if I have symbolic linked iosX86 and iosArm to a common directory? I assume I want false
to maintain compatibility with Windows collaborators?Brendan Weinstein
01/05/2020, 5:37 AMaddamsson
01/05/2020, 7:51 PMWeakReference
in Kotlin MPP? I have a custom EventBus
implementation which returns Subscription
objects whenever the user subscribes to an event. My problem is that it is easy to forget to call Subscription.unsubscribe
and there can be memory leaks when the subscriber drops the reference to the Subscription
but the EventBus
retains it forever. Is there a best practice for this scenario in the context of MPP?Brendan Weinstein
01/06/2020, 6:16 AMfun render(state: ViewState)
and observes ViewState
's emitted by a StateMachine. The StateMachine is shared in the common module. If the analytics events are fired in the StateMachine, then the developer who implements the View would have to avoid using the shared StateMachine or use it in a way that breaks functionality in order to make analytics events inconsistent, which is a loose coupling and better than no coupling.vanniktech
01/06/2020, 10:32 PMEngine
API to bake Starscream or any other third party library into itJoey
01/08/2020, 1:51 AMrelease
features like the ones on github.tylerwilson
01/08/2020, 2:57 AMBig Chungus
01/08/2020, 12:26 PMKris Wong
01/08/2020, 5:41 PMGin Wang
01/08/2020, 7:58 PMagta1991
01/09/2020, 11:47 AMPiasy
01/09/2020, 11:52 AMViewController.m
) calls iOS kotlin function (KmppBootstrap.test
, built to iOS static library), which accept an ObjC object (IOSDummyObj
from IOSDummyFramework.framework
), if KmppBootstrap.test
use IOSDummyObj
, my app will crash at Kotlin_Interop_refToObjC
with EXC_BAD_ACCESS (code=1, address=0x1a102ba0120)
, but if KmppBootstrap.test
don't, my app runs fine.
Could you guys please help me, thanks!
I upload my repro project onto GitHub, in the ios_static_lib_repro
branch of https://github.com/Piasy/KmppBootstrap , my iOS kotlin code is mainly kmpp/src/iosMain/kotlin/com/piasy/kmpp/KmppBootstrap.kt
, and iOS app is under iOSExample2/iOSExample2/ViewController.m
.
Or maybe my app code is wrong?
IOSDummyObj* obj = [[IOSDummyObj alloc] initWithInt:42];
libkmpp_ExportedSymbols* lib = libkmpp_symbols();
libkmpp_kref_com_piasy_kmpp_KmppBootstrap kmpp = lib-><http://kotlin.root.com|kotlin.root.com>.piasy.kmpp.KmppBootstrap.KmppBootstrap();
libkmpp_kref_Dummy_IOSDummyObj dummy;
dummy.pinned = (__bridge libkmpp_KNativePtr)(obj);
lib-><http://kotlin.root.com|kotlin.root.com>.piasy.kmpp.KmppBootstrap.test(kmpp, dummy);
Sylvain Patenaude
01/09/2020, 6:23 PMvanniktech
01/10/2020, 5:42 PMio.ktor:ktor-client-core-native
and I’m getting this:
CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
ptcl = htps;
"r_Attributes" = 1;
sdmn = "oauth2/client";
srvr = "<http://myserver.app|myserver.app>";
sync = syna;
}
Does anyone know what could be the issue?mzgreen
01/11/2020, 12:52 PMcommon
- commonMain (contains expect classes)
- jvmMain (contains actual classes for jvm)
- jsMain (contains actual classes for js)
jvm (contains a jvm project and depends on common)
- JVMMainClass
js (contains a js project and depends on common)
- JSMainClass
the jvm works fine but I have a problem with js module. JSMainClass
sees classes from common module but the implementations are from jvmMain instead of jsMain. How do I fix that?Shan
01/12/2020, 1:28 AMcommonMain
in a mpp gradle file?Shan
01/12/2020, 3:11 AMjvmCore
|_ main
|_ kotlin
|_ test
|_ kotlin
instead of
jvmCoreMain
|_ kotlin
jvmCoreTest
|_ kotlin
But can't quite figure out how to configure my sourceSets properly. I have it set up like this:
sourceSets {
jvm().compilations {
val core by creating {
defaultSourceSet {
dependencies { //etc }
}
}
val coreTest by creating {
defaultSourceSet {
dependencies { //etc }
}
}
}
}
Is it possible to set it up more like..
sourceSets {
jvm().compilations {
val core by creating {
sourceSet("main") {
dependencies {}
}
sourceSet("test") {
dependencies {}
}
}
}
}
?Shan
01/12/2020, 8:22 AM//project: android-local
//android config omitted
dependencies {
api(project(":android-remote"))
}
and then I have a mpp (in the same repo, different module)
//project: android-remote
kotlin {
jvm()
sourceSets {
val commonMain by getting {
dependencies {
implementation("core-lib") //an example
}
}
val jvmMain by getting {
//depends on commonMain by default
}
}
}
using api(project(":android-remote"))
does not add anything from android-remote
to the dependencies of android-local
. Is there some way I need to specify the target it since android-remote
is a MPP? Or is this not possible?Shan
01/12/2020, 8:22 AM//project: android-local
//android config omitted
dependencies {
api(project(":android-remote"))
}
and then I have a mpp (in the same repo, different module)
//project: android-remote
kotlin {
jvm()
sourceSets {
val commonMain by getting {
dependencies {
implementation("core-lib") //an example
}
}
val jvmMain by getting {
//depends on commonMain by default
}
}
}
using api(project(":android-remote"))
does not add anything from android-remote
to the dependencies of android-local
. Is there some way I need to specify the target it since android-remote
is a MPP? Or is this not possible?Ugi
01/12/2020, 1:11 PMenableFeaturePreview("GRADLE_METADATA")
In your project settings.gradle
Shan
01/13/2020, 9:22 PMUgi
01/14/2020, 11:25 PMimplementation("com.ionspin.kotlin:bignum:0.1.5")
with implementation(project(":bignum"))
. Maybe you'll spot some differences there that could help you.Shan
01/19/2020, 2:03 AMsikri
01/19/2020, 8:45 AMShan
01/19/2020, 8:51 AMsikri
01/19/2020, 8:54 AMplugins {
id("com.android.application")
kotlin("multiplatform")
kotlin("android.extensions")
kotlin("kapt")
id("kotlinx-serialization")
}
after android { ... }
put
kotlin {
android()
}
The only problem is with kapt
, as for now I have to write "kapt"(someDep)
instead of kapt(someDep)
Shan
01/19/2020, 10:16 PMjvmMainApi
and jvmCompile
and all sorts of variations of configs that are supplied by the multiplatform plugin, but the one I needed was jvmDefault
.
api(project(":android-remote","jvmDefault"))
It now sees `android-remote`'s dependencies correctly!jvmDefault
configuration in order to get the project sources to point to the correct project instead of the sources jar. I added the multiplatform plugin to my android library and used the android()
setup as specified above, but used jvmDefault
as the configuration for the project as I didn't want a specific android target on my android-remote
mpp. Everything works great now!