kotlin-multiplatform

Unable to add apple device in Android studio

a 夏天 提交于 2020-11-29 09:51:04
问题 I want to try out the Kotlin Multiplatform Mobile (KMM) in Android studio. I have installed the Plugin and when I try to add configuration for IOS, nothing shows up. I just have an IOS option but nothing shows up when I click on it. The android device is already set up, so I was able to run it in Android. 回答1: I guess you are not running Android Studio on macOS . You must have macOS to compile through XCode and use Apple Simulators . If you are running AS on macOS and you created the project

Create fat jar from ktor Kotlin multiplatform project with Kotlin Gradle DSL

天大地大妈咪最大 提交于 2020-07-23 07:38:06
问题 Trying to create a runnable jar for a kotlin multiplatform project which includes a ktor server component, building with Kotlin Gradle DSL. I have seen several questions including Create fat jar from kotlin multiplatform project which asks and answers how to create the gradle build file in Groovy, but how do you do it in kotlin dsl? The groovy code that is reported to work is: kotlin { jvm() { withJava() jvmJar { manifest { attributes 'Main-Class': 'sample.MainKt' } from { configurations

Create fat jar from ktor Kotlin multiplatform project with Kotlin Gradle DSL

对着背影说爱祢 提交于 2020-07-23 07:37:16
问题 Trying to create a runnable jar for a kotlin multiplatform project which includes a ktor server component, building with Kotlin Gradle DSL. I have seen several questions including Create fat jar from kotlin multiplatform project which asks and answers how to create the gradle build file in Groovy, but how do you do it in kotlin dsl? The groovy code that is reported to work is: kotlin { jvm() { withJava() jvmJar { manifest { attributes 'Main-Class': 'sample.MainKt' } from { configurations

Kotlin multiplatform 'Go to declaration' goes to decompiled code

坚强是说给别人听的谎言 提交于 2020-07-20 07:56:39
问题 When using using Android Studio's 'Go to declaration' feature (cmd + click), a decompiled source is shown, when though the source is in my project. The kotlin MP source is in another module. I can connect the source using the 'choose sources...' option, however I have to do this for each file. Is there a global fix for connecting to the correct source files? 来源: https://stackoverflow.com/questions/61230781/kotlin-multiplatform-go-to-declaration-goes-to-decompiled-code

Kotlin multi-platform framework file is too large

烂漫一生 提交于 2020-07-10 07:33:27
问题 We created a multi-platform framework file by building my project with the following packForXCode . It creates a framework file of the size 5.3 MB , which is too large. When I add it as part of my iOS extension module, it fails during initiation. The file works fine when inited in the main app. My pack for Xcode: task packForXcode(type: Sync) { final File frameworkDir = new File(buildDir, "xcode-frameworks") final String mode = project.findProperty("XCODE_CONFIGURATION")?.toUpperCase() ?:

Getting kotlinx serialization working in multiplatform project

不羁的心 提交于 2020-06-29 06:43:31
问题 I'm taking Kotlin seriazliation for a test drive in a multiplatform project in Kotlin 1.4-M2, following the tutorial on github, but i'm not getting the serialization bit to compile. This is my build.gradle.kts plugins { val kotlinVersion = "1.4-M2" kotlin("multiplatform") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion } repositories { mavenCentral() maven { url = uri("https://dl.bintray.com/kotlin/kotlin-eap") } maven { url = uri("https://kotlin.bintray.com/kotlinx

Create fat jar from kotlin multiplatform project

放肆的年华 提交于 2020-06-15 19:46:49
问题 I recently switched from old 1.2 multiplatform into 1.3. Difference is, there's one one build.gradle file per multiplatform module (I got 5 of them) so a lot less configuration. However I can't seem to be able to configure creating runnable fat jar with all dependencies from jvm platform. I used to use standard "application" plugin in my jvm project and jar task, but that does not work anymore. I found there's "jvmJar" task and I modified it (set Main-class), but created jar doesn't contain

Kotlin Multiplatform Android Imports won't resolve

冷暖自知 提交于 2020-01-29 21:40:31
问题 I have created a very simple KMP project, with the following structure: -Root --app --gradle --SharedCode --src\commonMain\kotlin\actual.kt --src\iosMain\kotlin\actual.kt --scr\androidMain\kotlin\actual.kt --build.gradle.kts --native --KotlinIOS --iOS project (xcodeproj, etc) Everything works, and the basic project work on both Android and iOS platforms. But when I try to use an android-specific import statement in my androidMain directory, the import statement won't resolve : import android

Kotlin native interop linker could not find framework

本小妞迷上赌 提交于 2020-01-22 20:47:22
问题 I'm trying to use cocoapods framework in Kotlin Multiplatform project. So I added framework to Pods file. ran pod install. created .def file added cinterop config in build.gradle ./gradlew cinteropFirebaseIos runs successfully. It generates .klib so I can see classes in kotlin code. But when I'm trying to run iOS app build fails with message: Showing Recent Messages > Task :app:linkDebugFrameworkIos ld: framework not found FirebaseDatabase /Applications/Xcode.app/Contents/Developer/Toolchains

Can't use kotlin-multipatform project

馋奶兔 提交于 2020-01-05 04:18:15
问题 I try to create my first Kotlin multiplatform project in Intellij Idea Community 2019.2.3. Was used default IDE project: enter image description here But even default project build with exception like this ko my versions: koltin 1.3.50 gradle: 4.4.1 Groovy: 2.4.16 What's wrong? How can I fix it? 回答1: You need to update the Gradle version. The kotlin-multiplatform plugin that is used to build multiplatform projects is only compatible with Gradle versions 4.7 and above, as said in the reference