curioustechizen
02/26/2020, 11:15 AMexpect/actual
. Is Kotlin code in commonMain
supposed to be able to access code in iosMain
or androidMain
even without using the expect/actual
mechanism?
So, if I have different implementations of fun getPlatformName(): String
each in iosMain
and androidMain
, but I don't declare expect fun getPlatformName(): String
in commonMain
am I still supposed to be able to call this function from commonMain
?Sean Keane
02/26/2020, 12:22 PMmap
across all three platforms, the packages aren’t being imported. Has anyone else had this issue and managed to rectify it?Steven
02/26/2020, 1:30 PMNikita Khlebushkin
02/26/2020, 6:09 PMpodspec
, then specified pod 'my-pod', :path => '../my-pod'
in project's Podfile and ran pod install
. I can import classes in Xcode and autocomplete works just fine, but when I try to build it, I get
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AnalyticsInitParameters", referenced from:
objc-class-ref in ContentView.o
"_OBJC_CLASS_$_AnalyticsAnalytics", referenced from:
objc-class-ref in ContentView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What am I doing wrong? Did I skip anything?Nikita Khlebushkin
02/26/2020, 10:41 PMdarkmoon_uk
02/27/2020, 8:58 AMritesh
02/27/2020, 9:57 AMreified inlined function
is not yet supported in KMP for iOS? Basically I have wrapped Json.nonstrict.parseList
in a different function which looks like inline fun <reified T : Any> listParser(): List<T> { ... }
. It’s crashing on iOS saying Uncaught Kotlin exception: kotlin.IllegalStateException: unsupported call of reified inlined function
though it’s working fine on Android. Just wanted to check if it’s not supported or am I doing something wrong 😅dambakk
02/27/2020, 10:06 AMexpect/actual
answer to this question, but I cant seem to figure it out. We are using Klock
to handle dates in our mpp project. How can we expose this type as a NSDate
for the ios platform?Jeff
02/27/2020, 12:07 PMimport kotlinx.coroutines.runBlocking
internal actual fun <T> runTest(block: suspend () -> T): T {
return runBlocking { block() }
}
Tim Hauptmann
02/27/2020, 12:20 PMNativeSqliteDriver(MyDatabase.Schema, "file:///private/var/mobile/Containers/Shared/AppGroup/.../test.db")
But this is forbidden by:
private fun checkFilename(name: String) {
if (name.contains("/")) {
throw IllegalArgumentException(
"File $name contains a path separator"
)
}
}
Someone knows the proper way to setup this?CLOVIS
02/27/2020, 3:07 PMJeff
02/27/2020, 4:51 PMCLOVIS
02/27/2020, 5:42 PM./gradlew jsTest
I get:
> Task :kotlinNpmInstall FAILED
error package.json: Name contains illegal characters
I tracked it down to this GitHub issue: https://github.com/yarnpkg/yarn/issues/1120 which says it's a problem of whitespace character in the project name. I do have whitespace in the name of my project, since that's allowed with Gradle—but apparently it's not with Yarn. Is there a way to tell the Multiplatform plugin to escape the whitespace with something else (for example underscores) automatically?
I found the generated package.json
in build/js/package.json
and the name of the project does contain spaces there as well.Joan Colmenero
02/27/2020, 7:55 PMSebastien Leclerc Lavallee
02/28/2020, 5:21 AMObserver
is defined inside RxCommon which is linked in the sourceCommon
source set. If I try to instanciate an Observer, XCode doesn’t find this class. How is it possible to access classes inside external libraries from the Swift code? I can do this inside one of my Android app’s Activity. Thanks!Nikita Khlebushkin
02/28/2020, 12:01 PMThere is a library attached to the project that was compiled with an older Kotlin/Native compiler and can't be read in IDE:
"analytics-cinterop-Analytics.klib" at $project/analytics/build/classes/kotlin/iosX64/main/analytics-cinterop-Analytics.klib
Please edit Gradle buildfile(s) to use Kotlin Gradle plugin version 1.3.61. Then rebuild the project and re-import it in IDE.
The only place that I apply multiplatform plugin has
kotlin("multiplatform") version "1.3.61"
How can I fix it?Orhan Tozan
02/28/2020, 1:59 PMSylvain Patenaude
02/28/2020, 3:07 PMSebastien Leclerc Lavallee
02/28/2020, 4:53 PMOrhan Tozan
02/29/2020, 12:06 AMCannot access built-in declaration 'kotlin.Nothing'. Ensure that you have a dependency on the Kotlin standard library
Orhan Tozan
02/29/2020, 12:13 AMnrobi
03/02/2020, 6:40 AMDariusz Rusin
03/02/2020, 7:00 AMjava.lang.NoClassDefFoundError
Orhan Tozan
03/02/2020, 4:48 PMjvmMain
sourceset for kotlin coroutines? Couldn't find anything at the README of the coroutines repo. Also, is there a reason why this doesn't come out-of-the-box? E.g. when I declare that I want to use kotlin coroutines in the project, it could automatically import the specific platform dependencies itself.Mike
03/02/2020, 5:54 PMJustin Shapiro
03/02/2020, 7:24 PMEben Du Toit
03/03/2020, 8:18 AMArthur Brum
03/03/2020, 1:45 PMNikita Khlebushkin
03/03/2020, 2:00 PMAndreas Jost
03/03/2020, 2:08 PMViewContainer
, which is a typealias for View
on Android-side and UIView
on iOS-side. And an extension function ViewContainer.setVisibility(isVisible: Boolean)
. And you also have a second expected class TextField
, which is a typealias for Android EditText
/ iOS UITextField
. EditText
is a subclass of TextView
, which is a subclass of View
. UITextField
is a subclass of UIControl
, which is a subclass of UIView
. So both are related to `View`/`UIView` (ViewContainer
). It would be nice to tell that the compiler, so that you can invoke the function setVisibility()
not only on ViewContainer
, but also on TextField
or other related classes.
Obviously expect class TextField : ViewContainer
won't work, because it isn't a direct child class. So one way is not having a hierarchy and copy/paste the same extension function with the same implementation to TextField
and every View type. But shouldn't there be any better solution?