bmo
03/04/2021, 8:36 AMHaiTrvn Lưu Trữ
03/04/2021, 10:11 AMBen Brugman
03/04/2021, 1:03 PMjamieadkins95
03/04/2021, 4:25 PMcontent-data football-data
| |
v v
content-domain football-domain
\ /
\ /
\ /
v v
common
(In reality we have 25+ sdks that sorta follow this dependency structure, and 15+ apps that use them to varying levels)
When converted to KMM modules this works fine on Android. We declare the dependency on content-data and gradle will see the transitive dependency on content-domain and download that too. However on iOS when they bring the content-data framework in, ‘duplicate’ classes get prefixed with the library name. For example content-domain defines a DispatcherProvider
interface that content-data provides an implementation of called DispatcherProviderImpl
.
In the iOS frameworks, DispatcherProvider
gets generated as 2 different protocols:
__attribute__((swift_name("DispatcherProvider")))
@protocol Content_domain_kmmDispatcherProvider
@required
- (Content_domain_kmmKotlinx_coroutines_coreCoroutineDispatcher *)computation __attribute__((swift_name("computation()")));
- (Content_domain_kmmKotlinx_coroutines_coreCoroutineDispatcher *)io __attribute__((swift_name("io()")));
- (Content_domain_kmmKotlinx_coroutines_coreCoroutineDispatcher *)ui __attribute__((swift_name("ui()")));
@end;
and
__attribute__((swift_name("Content_domain_kmmDispatcherProvider")))
@protocol Content_data_kmmContent_domain_kmmDispatcherProvider
@required
- (Content_data_kmmKotlinx_coroutines_coreCoroutineDispatcher *)computation __attribute__((swift_name("computation()")));
- (Content_data_kmmKotlinx_coroutines_coreCoroutineDispatcher *)io __attribute__((swift_name("io()")));
- (Content_data_kmmKotlinx_coroutines_coreCoroutineDispatcher *)ui __attribute__((swift_name("ui()")));
@end;
Anywhere in content-domain that asks for a DispatcherProvider can’t take the implementation provided by content-data because it now implements a different interface/protocol
This issue is also described in this post under subtitle
‘How well do the modules talk to each other?’
https://dev.to/touchlab/multiple-kotlin-frameworks-in-an-application-34e9
Q: Is the multiple sdk setup I’ve described possible with KMM? Is there any way around this, maybe by combining all the source sets into one before generating the iOS framework?Marko Novakovic
03/04/2021, 9:46 PMDerek Ellis
03/05/2021, 1:31 AMcheck
is run compileDebugAndroidTestKotlinAndroid
fails because it can't find the actual
declaration for a JVM module. It worked before, and the actual declarations are there.. I can run testDebugUnitTest
successfully too. Did something change or am I missing something obvious?clark
03/05/2021, 3:11 PMbuild.gradle.kts
files generated by the KMM template to not be like entirely red?Gene Cahill
03/05/2021, 5:03 PMShannon Rhodes
03/05/2021, 8:53 PMwilliam
03/06/2021, 2:18 PMatomicfu
in a multiplatform project for common code? having some trouble with it and could use a reference projectclark
03/06/2021, 8:51 PMandroidMain
and androidTest
directories get treated like kotlin code in my KMM project?
My commonMain
doesn't get any autocomplete and can't find other packages I create inside of it
UPDATE: Marking the kotlin
directory within those directories made all of the intellisense features work.clark
03/06/2021, 8:56 PMshared.iml
fileSebastian Peredo Murga
03/06/2021, 9:34 PMLei Wu
03/07/2021, 5:27 AMArkadii Ivanov
03/07/2021, 11:57 AMShannon Duncan
03/07/2021, 7:17 PMcompile("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
however I don't know where in the build.gradle.kts file to put it.
When running the jar in JVM right now I get the error : java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
william
03/07/2021, 8:58 PMinit
block and then top level value assignments causing an exception. heres a min example:
class Foo(bar: Bar) {
init {
CoroutineScope(Dispatchers.Default).launch {
bar.buzz()
}
}
val a = 3
}
in the init block since bar is accessed, it seems like that is causing the entire foo object to also get frozen
then when it gets to val a = 3
during runtime - it complains about foo instance already being frozen. how can i go about fixing this?eygraber
03/08/2021, 5:19 AMDaniele B
03/08/2021, 2:51 PMbuildSrc
folder.
Is there any reason to use that instead of just define them in the global gradle file buildscript
section?sushma nayak
03/09/2021, 5:55 AMAbhishek Dewan
03/09/2021, 7:33 AMAshish Kumar Joy
03/09/2021, 1:15 PMsushma nayak
03/09/2021, 2:36 PMAshish Kumar Joy
03/10/2021, 6:58 AMAndyeshiet
03/10/2021, 11:34 AMjava.util.pattern
trying to validate emailBen Brugman
03/10/2021, 12:32 PMKathrin Petrova
03/10/2021, 3:35 PMJack Darlington
03/10/2021, 5:25 PMDaniele B
03/10/2021, 9:15 PMresources
folder, and access the strings (just within the CommonMain, as it’s for a shared KMPViewModel) similarly to how it happens in Android?eygraber
03/11/2021, 7:28 AMeygraber
03/11/2021, 7:28 AMKris Wong
03/11/2021, 2:01 PMrusshwolf
03/11/2021, 2:07 PMKris Wong
03/11/2021, 2:10 PMrusshwolf
03/11/2021, 2:14 PM