kotlin-multiplatform

Kotlin Multiplatform - ERROR ITMS-90171: Invalid Bundle Structure

淺唱寂寞╮ 提交于 2021-02-19 06:07:30
问题 I've a problem trying to distribute my iOS app with Kotlin Multiplatform on the Apple App Store: ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'Smiledu_app.app/Frameworks/shared.framework/shared' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure." This

Kotlin Multiplatform - ERROR ITMS-90171: Invalid Bundle Structure

只愿长相守 提交于 2021-02-19 06:07:28
问题 I've a problem trying to distribute my iOS app with Kotlin Multiplatform on the Apple App Store: ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'Smiledu_app.app/Frameworks/shared.framework/shared' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure." This

`runBlocking` coroutine builder is not resolved in the project (Other builders are resolved)

☆樱花仙子☆ 提交于 2021-02-08 08:20:52
问题 As the title suggest, the coroutine builder runBlocking is missing in the coroutine liblary I just added in my build.gradle. Funny thing is every other thing appears to be available, GlobalScope , CoroutineScope.launch CoroutineScope.async all present. runBlocking isn't. What am I doing wrong? here is my build.gradle buildscript { ext { ktor_version = "1.1.1" kotlin_version = "1.3.20-eap-52" } dependencies { classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.44" classpath "org

`runBlocking` coroutine builder is not resolved in the project (Other builders are resolved)

隐身守侯 提交于 2021-02-08 08:20:03
问题 As the title suggest, the coroutine builder runBlocking is missing in the coroutine liblary I just added in my build.gradle. Funny thing is every other thing appears to be available, GlobalScope , CoroutineScope.launch CoroutineScope.async all present. runBlocking isn't. What am I doing wrong? here is my build.gradle buildscript { ext { ktor_version = "1.1.1" kotlin_version = "1.3.20-eap-52" } dependencies { classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.44" classpath "org

Kotlin Native iOS string formatting with vararg

隐身守侯 提交于 2021-02-08 04:59:50
问题 Based on this issue about using NSString formatting I try to implement multiplatform implementation for formatting when using vararg , with no luck so far. What I did added FoundationInterop.def language = Objective-C --- #import <Foundation/NSString.h> NSString* format(NSString* format, ...) { va_list args; va_start(args, format); NSString* result = [[NSString alloc] initWithFormat:format arguments:args]; va_end(args); return result; } compiled it in gradle targets { final def iOSTarget =

Error: Declaration annotated with @OptionalExpectation can only be used in common module sources

我与影子孤独终老i 提交于 2021-01-29 13:24:52
问题 Update (2018-11-03) This is a known issue that is being tracked here. Original Post I am playing around with Kotlin MPP, specifically with Kotlin 1.3 and the new structure. After converting a Kotlin 1.2 MPP to the new structure, I keep getting these errors: Error:(3, 18) Kotlin: [MPP_jvmMain] Declaration annotated with '@OptionalExpectation' can only be used in common module sources These are referring to the @JsName() annotations I have within my common module. I have tried: Starting a

Kotlin multiplatform project

陌路散爱 提交于 2021-01-28 13:39:22
问题 I want to write a common library using Kotin multiplatform that can be used on android and on ios . This library will have dependencies for each platform, for eg: on android I want to add jsoup as a dependency and on ios I want to add swiftsoup For android adding java libraries as dependencies is rather easy, but for ios I could not find a way. The question is: how can I add a swift library as a dependency to this project for ios ? or can somebody point me to a working project as an example?

Listen to Kotlin coroutine flow from iOS

倖福魔咒の 提交于 2021-01-27 06:43:20
问题 I have setup a Kotlin Multiplatform project and attached a SQLDelight database to it. Its all setup and running correctly as i have tested it on the android side using the following: commonMain: val backgroundColorFlow: Flow<Color> = dbQuery.getColorWithId(BGColor.id) .asFlow() .mapToOneNotNull() which triggers fine in the Android projects MainActivity.kt using: database.backgroundColorFlow.onEach { setBackgroundColor(it.hex) }.launchIn(lifecycleScope) but when trying to access the same call

Listen to Kotlin coroutine flow from iOS

半世苍凉 提交于 2021-01-27 06:42:09
问题 I have setup a Kotlin Multiplatform project and attached a SQLDelight database to it. Its all setup and running correctly as i have tested it on the android side using the following: commonMain: val backgroundColorFlow: Flow<Color> = dbQuery.getColorWithId(BGColor.id) .asFlow() .mapToOneNotNull() which triggers fine in the Android projects MainActivity.kt using: database.backgroundColorFlow.onEach { setBackgroundColor(it.hex) }.launchIn(lifecycleScope) but when trying to access the same call

Kotlin Multiplatform: How to mock objects in a unit test for iOS

若如初见. 提交于 2021-01-26 04:58:55
问题 I'm working on a Kotlin-multiplatform (KMP) library for iOS / Android. I have written some unit tests for JVM, for which I use MockK to create spies and mocks, but MockK doesn't support Kotlin native fully yet. Therefore, I was wondering how others working on KMP projects write unit tests for the iOS platform. An example would be really appreciated. 回答1: Currently, MockK does not support Kotlin/Native or Kotlin/JS. However, both are placed as important items on the project backlog: Kotlin