Mirco
Mirco

Reputation: 75

Issue with compose multiplatform - Windows

I'm struggling with an issue in my compose multiplatform project. I made an app using ktor and ktorfit, having everything working fine on debug and also while testing the msi on my Windows 11 notebook. Then I built an msix using the msix packaging tool, without any issue. A friend of mine helped me testing the app and, downloading the app via microsoft store on her PC, the api calls simply won't start. Previously everything was fine on the msi.

I tried to update dependencies and to include the internetClient capability inside the msix manifest, but I'm still blocked. Here are my compose.desktop gradle snippet, dependencies and logs:

compose.desktop {
application {
    mainClass = "com.myapp.sample"

    buildTypes.release.proguard {
        version.set("7.4.2")
        configurationFiles.from(project.file("proguard-rules.pro"))
        isEnabled.set(false)
        obfuscate.set(false)
    }

    nativeDistributions {
        modules("jdk.crypto.ec")
        targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
        windows {
            iconFile.set(project.file("icon.ico"))
            shortcut = true
            menu = true
        }
        packageName = "my app"
        packageVersion = "1.0.3"
    }
}

api ->    REQUEST https://myapi.com/test failed with exception: io.ktor.client.plugins.HttpRequestTimeoutException: Request timeout has expired [url=https://myapi.com/test, request_timeout=30000 ms]: HTTP Client

My api 2 -> 2025-02-26 09:22:16.478 [DEBUG] REQUEST https://myapi2.com/test failed with exception: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target: HTTP Client
2025-02-26 09:22:16.494 [ERROR] : Error during registration
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
    at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at java.base/sun.security.validator.Validator.validate(Unknown Source)
    at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
    at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    at io.ktor.network.tls.TLSClientHandshake.handleCertificatesAndKeys(TLSClientHandshake.kt:236)
    at io.ktor.network.tls.TLSClientHandshake.access$handleCertificatesAndKeys(TLSClientHandshake.kt:25)
    at io.ktor.network.tls.TLSClientHandshake$handleCertificatesAndKeys$1.invokeSuspend(TLSClientHandshake.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)

Upvotes: 0

Views: 26

Answers (0)

Related Questions