Djuro
03/15/2024, 9:23 AMjava.net.UnknownHostException
is thrown on Android when io.ktor.client.engine.darwing.DarwingRequestException
is thrown on iOS
I was thinking on making mappers and then re-throwing. What's the best practice in this case in your opinion?Ray Rahke
03/15/2024, 10:48 AMbuild.gradle.kts
plugins {
kotlin("multiplatform") version "1.9.23"
application
}
repositories {
mavenCentral()
}
application {
mainClass.set("MainKt")
}
kotlin {
sourceSets {
val commonMain by getting {
kotlin.srcDir("src")
resources.srcDir("res")
dependencies {
/* ... */
}
}
}
}
directory structure
├── README.md
├── build
├── build.gradle.kts
├── gradle
│ ├── libs.versions.toml
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle.kts
└── src
└── main.kt
src/main.kt
fun main() {
println("Hello")
}
output of gradle run
> Task :run FAILED
Error: Could not find or load main class MainKt
Caused by: java.lang.ClassNotFoundException: MainKt
I have tried a few different combinations of folder structures and none work. the docs are super implicit and vague about how this works.Marc
03/15/2024, 10:53 AMContext Receivers
on KMP
? It’s an amazing feature I’m planning to add in one of my libs but make no sense if there won’t be any support 😕uli
03/15/2024, 11:50 AMcompileCommonMainKotlinMetadata
due to an error in one of my actual app source files. (just a typo in the imports).
I don’t think I have ever seen that on pure android projects so it was quite surprising to me to see that the actual app sources are relevant for the sync process. And it is a real pain to make the app sources compile again without your IDE working.
Am I doing something wrong here?
Is this just a plain (known?) bug that needs to be fixed in the gradle plugin?
Or does it work as designed due to some multi platform requirements?
I’d be thankful if anyone could shed some light on that issue.Hasan Tunçay
03/15/2024, 12:23 PMMarko Novaković
03/15/2024, 12:44 PMcommonTest
inside Android and iOS tests that are outside shared module?Raghavan
03/15/2024, 1:23 PMHenri Gourvest
03/15/2024, 7:18 PMdewildte
03/15/2024, 11:05 PMClaudioVieira
03/16/2024, 3:31 PMstoyicker
03/16/2024, 4:05 PMGleb
03/16/2024, 10:43 PMCupertinoSwipeBox
making it into the next release? I would very much like to use swipe box features in my app, and currently I'm working with this one. The issue is, it's doesn't feel very IOS and it is also based on the deprecated SwipeableState
Really looking forward to your take on this!alexandre mommers
03/17/2024, 12:13 AMRoger Kreienbühl
03/17/2024, 12:42 PMcompose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "compose" }
(compose version 1.6.2
as it is when generating a project on: https://kmp.jetbrains.com)
I added the dependency under commonMain.dependencies
as implementation(libs.compose.ui)
. Whe I try to build the android app, I get the following errors:
Unresolved reference: toComposeImageBitmap
Unresolved reference: toComposeImageBitmap
Unresolved reference: toComposeImageBitmap
Unresolved reference: drawImage
First error is on the import: import androidx.compose.ui.graphics.toComposeImageBitmap
second and third are on usage.
The drawImage error is on
drawIntoCanvas {
it.nativeCanvas.drawImage(Image.makeFromBitmap(bitmap), l.toFloat(), t.toFloat())
}
What am I doing wrong?Mats-Hjalmar
03/17/2024, 12:42 PMMarko Novaković
03/17/2024, 3:43 PMcommonTest
from shared KMM module inside Android and iOS apps.
for Android it’s easy, just set srcDir
and that’s it, but how to do that on iOS side?Muhammad Rehan
03/17/2024, 4:28 PMKarthick
03/17/2024, 4:49 PMandroidx.lifecycle.ViewModel
. But the problem was that i created these in shared
module and when i used shared
module in another module and created FeatureViewModel in commonMain, it is giving error of Cannot access 'androidx.lifecycle.ViewModel' which is a supertype of 'FeatureViewModel'. Check your module classpath for missing or conflicting dependencies
.
Why common code worrying about actual implementations?Nacho Ruiz Martin
03/17/2024, 5:35 PMRoger Kreienbühl
03/18/2024, 8:20 AMImage.makeFromEncoded(this).toComposeImageBitmap()
Is there a way to get a mutable ImageBitmap instead of immutable one?
I try to draw this on a Canvas and always get the error kotlin.IllegalArgumentException: Cannot draw on immutable ImageBitmap
humbledroid
03/18/2024, 9:31 AM:core
which has the whole networking layer, model, which will then be used by another module :analytics
, :error-logger
, :auth-feature
and so on. and then these modules can be consumed in the iOS and android apps.
while building a framework/xcframework for iOS side, all of this would get packaged in single xcframework and while consuming in iOS side, we will end up, consuming unnecessary modules in the respective modules in iOS side. like a feature module might not auth module at all, but just error logger, but the framework will have all of it.
are there any strategies or something that can be done in order to achieve this, I have gone through a few issues and open issues on youtrack.
here
https://github.com/JetBrains/kotlin-native/issues/2423
https://github.com/JetBrains/kotlin-native/issues/2423#issuecomment-465384562
https://github.com/JetBrains/kotlin-native/issues/4013
https://youtrack.jetbrains.com/issue/KT-42247Sebastian Schuberth
03/18/2024, 9:52 AMDuong Vietnam
03/18/2024, 2:35 PMDuong Vietnam
03/18/2024, 3:00 PMDaniele B
03/18/2024, 3:15 PMFailed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-34 Android SDK Platform 34
build-tools;34.0.0 Android SDK Build-Tools 34
even though, when I run:
~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager --licenses
it tells me: "All SDK package licenses accepted."
I am running IntellijIDEA CE
How can I solve this problem?
UPDATE:
I was able to solve it by running it on Android Studio.
After that, I can now run it on IntellijIDEA CE, and the error is not there anymore.Jey
03/18/2024, 3:34 PMdewildte
03/18/2024, 5:57 PMcomposeAndroid
app from Fleet I got the following error:
Argument for @NotNull parameter 'abiType' of com/android/tools/idea/avdmanager/AvdManagerConnection$SystemImageUpdateDependency.updateRequired must not be null
Has anyone run into this error in Fleet yet?Valentin B.
03/18/2024, 9:28 PMBackPress
handler. My tests are running on the JVM, I'm stuck with this error No OnBackPressedDispatcherOwner was provided via LocalOnBackPressedDispatcherOwner
What is the best way to fix that ?Simon Buechner
03/19/2024, 8:53 AMAlex Styl
03/19/2024, 12:50 PM