Rak
06/16/2021, 7:52 AMimplementation(kotlin("test-common"))
I understand the original gradle format well but I am finding information on the new kts format lackingNapa Ram
06/16/2021, 8:15 AMclass PersonaldetailsLocalDatasource() {
private val realm: Realm by lazy {
val configuration = RealmConfiguration(schema = setOf(PersonaldetailsDao::class))
Realm.open(configuration)
}
private var _personalDetailsObserver= MutableStateFlow<PersonaldetailsDao>(PersonaldetailsDao())
val personalDetailsObserver = _personalDetailsObserver.asStateFlow()
fun storePersonalDetail(personaldetailsDao: PersonaldetailsDao){
realm.writeBlocking {
copyToRealm(PersonaldetailsDao().apply {
firstName = personaldetailsDao.firstName
})
}
}
fun fetchData(): StateFlow<PersonaldetailsDao> {
realm.objects(PersonaldetailsDao::class)
realm.objects(PersonaldetailsDao::class).observe {
_personalDetailsObserver.value = it[0]
}
return personalDetailsObserver
}
}
John O'Reilly
06/16/2021, 9:50 AMTiago Nunes
06/16/2021, 10:22 AMimplement(project(":myLibrary"))
). When I sync and build for Android, everything works great, I even get code completion in iosMain.
But when I run for iOS, I get this error:
Task :MyLibrary:cinteropObjCLibraryIos FAILED
Exception in thread "main" java.lang.Error: /var/folders/26/l5zqw1v936l866mn2pwdy2j00000gn/T/7243334423362035241.m:1:9: fatal error: module 'ObjCLibrary' not found
Any ideas? I've been stuck for hours...Colton Idle
06/16/2021, 1:35 PMBailey Pollard
06/16/2021, 1:40 PMspierce7
06/16/2021, 3:14 PMYashar
06/16/2021, 4:53 PM:shared:linkDebugFrameworkIos
when trying to build iOS. Has anyone encountered this before?
Task :shared:linkDebugFrameworkIos FAILED
e: Compilation failed: /Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib: dlopen(/Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib, 1): no suitable image found. Did find:
/Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib: mach-o, but wrong architecture
/Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib: mach-o, but wrong architecture
* Source files:
* Compiler version info: Konan: 1.5.20-RC / Kotlin: 1.5.20
* Output kind: FRAMEWORK
e: java.lang.UnsatisfiedLinkError: /Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib: dlopen(/Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib, 1): no suitable image found. Did find:
/Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib: mach-o, but wrong architecture
/Users/user/.konan/kotlin-native-prebuilt-macos-1.5.20-RC/konan/nativelib/2514903830371359478/libllvmstubs.dylib: mach-o, but wrong architecture
spierce7
06/16/2021, 6:11 PMError: Invalid XcProject file
?Alberto
06/16/2021, 11:12 PMQueue
in Kotlin Multiplatform?Colton Idle
06/17/2021, 2:30 AMStefan Oltmann
06/17/2021, 7:21 AMNikiizvorski
06/17/2021, 9:52 AMRak
06/17/2021, 10:06 AMNikiizvorski
06/17/2021, 2:51 PMBailey Pollard
06/17/2021, 6:43 PMpod("StarIO", "~> 2.8.2")
And let me know if it succeeds for you?Rak
06/17/2021, 9:55 PMclass Greeting {
private val httpClient = httpClient() {
install(Logging) {
level = LogLevel.HEADERS
logger = object : Logger {
override fun log(message: String) {
Napier.v(tag = "HTTP Client", message = message)
}
}
}
install(JsonFeature) {
val json = Json { ignoreUnknownKeys = true }
serializer = KotlinxSerializer(json)
}
}.also { initLogger() }
@Throws(Throwable::class)
suspend fun greeting(): String {
return "${getHello().random().string}, ${Platform().platform}! X"
}
private suspend fun getHello(): List<Hello> {
return httpClient.get("<https://gitcdn.link/cdn/KaterinaPetrova/greeting/7d47a42fc8d28820387ac7f4aaf36d69e434adc1/greetings.json>")
}
}
I knew I wanted to do some json manipulation so I made the Json instance an instance variable:
class Greeting {
private val json = Json { ignoreUnknownKeys = true }
private val httpClient = httpClient() {
install(Logging) {
level = LogLevel.HEADERS
logger = object : Logger {
override fun log(message: String) {
Napier.v(tag = "HTTP Client", message = message)
}
}
}
install(JsonFeature) {
serializer = KotlinxSerializer(json)
}
}.also { initLogger() }
@Throws(Throwable::class)
suspend fun greeting(): String {
return "${getHello().random().string}, ${Platform().platform}! X"
}
private suspend fun getHello(): List<Hello> {
return httpClient.get("<https://gitcdn.link/cdn/KaterinaPetrova/greeting/7d47a42fc8d28820387ac7f4aaf36d69e434adc1/greetings.json>")
}
}
and now iOS crashes with an error:
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
It is considered unexpected and unhandled instead. Program will be terminated.
Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen com.jetbrains.kmmktor2.Greeting@3dbf5e8
Anyone know why?darkmoon_uk
06/18/2021, 5:22 AMFirebaseAuthentication
module and related files from your project on GitHub. I'm interested in building the same capability into my App; so I wanted to ask why that was - did you encounter a problem using the Firebase REST API's in this way? Thanks.Ethan Hsu
06/18/2021, 6:35 AMRak
06/18/2021, 10:23 AMJack W
06/18/2021, 1:40 PMGuilherme Delgado
06/18/2021, 4:31 PMAbhishek Dewan
06/19/2021, 7:00 AMBig Chungus
06/19/2021, 1:39 PMElka
06/20/2021, 7:15 AMimplementation
dependencies specified in submodules are exported when transitiveExport = true
? Shouldn’t it only export dependencies marked with api
?Hossein Amini
06/20/2021, 8:51 AMBailey Pollard
06/20/2021, 7:59 PMsaket
06/21/2021, 2:55 AMkotlin.time
APIs. I already have this in my buildscript as mentioned in the docs:
kotlin {
sourceSets {
all {
languageSettings.apply {
useExperimentalAnnotation("kotlin.RequiresOptIn")
useExperimentalAnnotation("kotlin.time.ExperimentalTime")
}
}
}
am I missing something?Alex
06/21/2021, 7:46 AMenum
classes in the shared module that I'm trying to use in a Picker
in iOS. I had no issues using the enums in Android, but the Picker
in SwiftUI requires the class to conform to CaseIterable
and RawRepresentable
. This hits a bit of a brick wall because you can only implement the RawRepresentable
interface within the source class and not in an extension, has anyone found a way around this or do you have to create two enum classes and map between them?Stefan Oltmann
06/21/2021, 9:47 AMStefan Oltmann
06/21/2021, 9:47 AMBig Chungus
06/21/2021, 9:56 AMStefan Oltmann
06/21/2021, 9:58 AMBig Chungus
06/21/2021, 9:58 AMStefan Oltmann
06/21/2021, 9:59 AM