eygraber
09/25/2022, 8:39 PMremoveEldestEntry
of a LinkedHashMap
?Martin Štrambach
09/26/2022, 11:10 AMclass MyClass {
...
companion object {
fun companionFun()
}
}
When we generate ObjC code out of this example it creates one interface for MyClass
and another one for MyClass.Companion
.
Then, in Swift we use it as MyClass.companion.companionFun()
. The issue is companion
nor companionFun
aren’t static because companion
is a singleton object.
Is there a way how to generate Swift static functions for Kotlin functions without the need of second interface?
I found one feature ticket which would potentially solve this issue but it is without any activity for a long time. https://youtrack.jetbrains.com/issue/KT-44862Robert Wijas
09/26/2022, 12:09 PMLandry Norris
09/26/2022, 1:14 PMsvenjacobs
09/27/2022, 5:48 AM@Preview
annotation. Although I added the compose.preview
dependency
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.ui)
implementation(compose.uiTooling)
implementation(compose.preview) // <--- see here
}
}
the androidx.compose.ui.tooling.preview.Preview
annotation is not found in the classpath of the code placed in commonMain
. What am I doing wrong?
JetBrains Compose 1.2.0-beta01
, Android Studio Electric Eel Beta 1Kevin Zhang
09/27/2022, 6:15 AMmultiplatform + springboot + react
. The application can’t find the javascript file.
I package the js
file into jar using:
tasks.getByName<BootJar>("bootJar") {
val webpackTask = tasks.getByName<KotlinWebpack>("reactBrowserDevelopmentWebpack")
dependsOn(webpackTask) // make sure JS gets compiled first
println(webpackTask.destinationDirectory)
println(webpackTask.outputFileName)
from(File(webpackTask.destinationDirectory, webpackTask.outputFileName))
archiveBaseName.set("${project.name}-with-dependencies")
}
and the jar actually has the js
file. But when i start the springboot application and visit the index page, it report not found error.
@GetMapping("/")
@ResponseBody
fun index() = createHTML().html {
head {
title("Hello,Kevin")
}
body {
div {
id = "root"
}
script(src = "kotlin-fullstack-v2.js"){}
}
}
Is there any fault in my code?Friedger
09/29/2022, 4:02 PMMeherdatta Chepuri
09/29/2022, 7:09 PMPiotr Prus
09/29/2022, 10:41 PMMike Digman
09/30/2022, 1:30 AMImageBitmap
. I'm aware of ImageComposeScene
in Compose Desktop and the various Android View
mechanisms that uses the the backing canvas. Is there anything cross-platform?Lukáš Kúšik
09/30/2022, 9:12 AMexpect value
classes.
I'm trying to create a multiplatform Color
class, backed by Compose's Color class in the jvm target.
// android module
actual typealias Color = androidx.compose.ui.graphics.Color
Compose Color
class contains getter for color components.
// Compose's Color class
@kotlin.jvm.JvmInline
value class Color(val value: ULong) {
val red: Float
get() {
...
}
}
I would like to put these getters into my expected Color
class and can't seem to find the correct syntax that would allow me to do it (see the attached image).Kartik Prakash
09/30/2022, 4:30 PMReason: AMDeviceSecureInstallApplicationBundle failed with err = -402620375(The code signature version is no longer supported.)
diesieben07
09/30/2022, 6:56 PMkotlinOptions.freeCompilerArgs += listOf("-Xcontext-receivers")
in the JVM compilation. But I don't know how to do it for the common module, since it does not seem to have a compilation. The IDE keeps reporting "The feature "context receivers" is experimental and should be enabled explicitly" in common code.Kirill Zhukov
10/01/2022, 12:15 AM.def
file and link binaries or something, is there Gradle plugin or examples on how to do that? (relatively new to KMM as well as Native ecosystem)Gillian Buijs
10/01/2022, 11:20 AMEugene Maksymenko
10/02/2022, 8:42 PMArun Joseph
10/03/2022, 7:32 PMMobile Dev.
10/04/2022, 2:33 PMclass TestRepo {
suspend fun test(): Int {
delay(5000)
return 10
}
}
and i'm trying to use test method in my ios application.
class ContentViewModel : ObservableObject {
@Published var training: Training_? = nil
@Published var k: String? = nil
@Published var isLoading = false
func fetchData() {
self.isLoading = true
TestRepo().test { vl, err in
self.isLoading = false
self.training = Training_.companion.doInit()
}
}
}
but when i try app in mobile phone i get these error on the xcode. i fix this issue with using DispatchQueue.main.async, is there any other way to fix this issue without using DispatchQueue ?Smorg
10/04/2022, 7:29 PMKartik Prakash
10/05/2022, 1:42 AMld: '/shared/build/cocoapods/synthetic/IOS/build/Release-iphoneos/FirebaseCrashlytics/FirebaseCrashlytics.framework/FirebaseCrashlytics' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/shared/build/cocoapods/synthetic/IOS/build/Release-iphoneos/FirebaseCrashlytics/FirebaseCrashlytics.framework/FirebaseCrashlytics' for architecture arm64
Has anyone seen this issue or know a workaround?zt
10/05/2022, 3:47 AMTheOnlyTails
10/05/2022, 10:59 AMGreg
10/05/2022, 5:54 PMTolriq
10/06/2022, 6:38 AMSarav Ramaswamy
10/06/2022, 9:36 PMdarkmoon_uk
10/07/2022, 8:51 AMpackForXcode
/`buildForXcode` task implemented - has it been deprecated?zt
10/08/2022, 4:21 AMAdam Cooper
10/08/2022, 7:26 PMrouting {
static("scripts") {
... // Serve JavaScript files from this endpoint
}
}
But instead of just writing JavaScript, I'd prefer to write Kotlin which is then compiled to JavaScript, and serve those generated files.
I found the full-stack tutorial in the docs, but the server is written in JavaScript and serves a full React application. I am serving a mostly-static webapp with a little bit of JavaScript.oday
10/08/2022, 8:22 PMWhen the project is compiled, the generated Kotlin code will be stored in thethis is right after implementingdirectory. The generator will create an interface with the named/shared/build/generated/sqldelight
, as we specified inAppDatabase
build.gradle.kts
AppDatabase.sq
with SQLDelightspierce7
10/09/2022, 4:11 PM