jordond / connectivity

🛜 Kotlin Multiplatform library for monitoring network connectivity
https://connectivity.jordond.dev/
MIT License
274 stars 5 forks source link

[Help] Missing Classes Proguard #57

Open abdallahmehiz opened 2 days ago

abdallahmehiz commented 2 days ago

Trying to use this library on compose multiplatform project, it works on debug variant, but trying to compile for release throws this

Missing class io.ktor.client.network.sockets.TimeoutExceptionsCommonKt (referenced from: io.ktor.utils.io.ByteReadChannel io.ktor.client.engine.android.AndroidURLConnectionUtilsKt.content(java.net.HttpURLConnection, kotlin.coroutines.CoroutineContext, io.ktor.client.request.HttpRequestData))
Missing class io.ktor.utils.io.CoroutinesKt (referenced from: java.lang.Object io.ktor.client.engine.android.AndroidClientEngineKt.writeTo(io.ktor.http.content.OutgoingContent, java.io.OutputStream, kotlin.coroutines.CoroutineContext, kotlin.coroutines.Continuation))

Adding the generated rules

# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn io.ktor.client.network.sockets.TimeoutExceptionsCommonKt
-dontwarn io.ktor.utils.io.CoroutinesKt

makes it compiles but crashes the app when trying to use the library with MissingMembers error.

abdallahmehiz commented 2 days ago

using ktor 3.0.0-wasm2 fixes this... this makes me not sure if it this is an issue from ktor or not. maybe this is relevant? https://youtrack.jetbrains.com/issue/KTOR-7479/KotlinReflectionInternalError-createClientPlugin-when-running-release-APK-on-Android