Niklas Wintrén
03/13/2025, 8:53 PMio.ktor.network.sockets. SocketBase$ attachFor$ 1: can't find enclosing method 'io.ktor.utils.io.ChannelJob attachFor(java.lang. String, io. ktor. utils. io. ByteChannel, kotlinx. atomicfu. AtomicRef, kotlin. jvm. functions. Function0) ' in program class io.ktor.network.sockets. SocketBase
• I am able to make the releaseDistribution and it crashes on startup blaiming
io.ktor.client.HttpClienEngineContainer: Provider io.ktor.client.engine. cio. CIOEngineContainer not found
Jan
03/14/2025, 11:22 AMJan
03/14/2025, 11:22 AMNiklas Wintrén
03/14/2025, 12:54 PMJan
03/14/2025, 2:52 PM-dontwarn io.ktor.network.sockets.SocketBase
-keep class io.ktor.client.engine.cio.** { *; }
-keep class io.ktor.client.HttpClientEngineContainer { *; }
But then a Ktor Serialization issue appeared, which I fixed with:
-keep class io.ktor.serialization.kotlinx.KotlinxSerializationExtensionProvider { *; }
-keep class io.ktor.serialization.kotlinx.json.KotlinxSerializationJsonExtensionProvider { *; }
Niklas Wintrén
03/15/2025, 1:29 PMNiklas Wintrén
03/15/2025, 1:46 PM:app -> :repo
Jan
03/15/2025, 4:37 PMJan
03/15/2025, 4:47 PMThe rules don't fix it for us, but that might be because of our multi-module setup. We'll look into itAlso, did you check if the proguard file actually gets used? Or where are you loading it
Niklas Wintrén
03/15/2025, 6:22 PM:sdk:client_platform
; we might combine/flatten some modules and simplify but that's what we have right now.Niklas Wintrén
03/16/2025, 9:34 AM-dontoptimize
from the ProGuard files then the Ktor optimisation gets weird because it struggles with incomplete preservations or that is what the AS Gemini tells me.
I get this error: Unexpected error while writing class [data/source/EarlyBackers] (Overflow of unsigned short value [131070])
Here's my :proguardReleaseJars
output at the time of the error:
Note: the configuration keeps the entry point 'io.ktor.client.engine.cio.UtilsKt$writeRequest$2 { UtilsKt$writeRequest$2(io.ktor.client.request.HttpRequestData,io.ktor.utils.io.ByteWriteChannel,boolean,boolean,kotlin.coroutines.CoroutineContext,kotlin.coroutines.Continuation); }', but not the descriptor class 'io.ktor.client.request.HttpRequestData'
Note: the configuration keeps the entry point 'io.ktor.client.engine.cio.UtilsKt$writeRequest$2 { UtilsKt$writeRequest$2(io.ktor.client.request.HttpRequestData,io.ktor.utils.io.ByteWriteChannel,boolean,boolean,kotlin.coroutines.CoroutineContext,kotlin.coroutines.Continuation); }', but not the descriptor class 'io.ktor.utils.io.ByteWriteChannel'
Unexpected error
java.lang.RuntimeException: Unexpected error while writing class [data/source/EarlyBackers] (Overflow of unsigned short value [131070])
at proguard.io.ClassDataEntryWriter.createOutputStream(ClassDataEntryWriter.java:104) ~[proguard-core-9.1.0.jar:7.4.0]
There are a bunch of similar "Note: keep entry point + but not descriptor" before the error.Niklas Wintrén
03/16/2025, 10:38 AM-dontoptimise
flag
If I remove it I get a bunch of "Note"s/warnings regarding keeps and descriptors
ex: Note: the configuration keeps the entry point 'io.ktor.util.AttributeKey { io.ktor.util.AttributeKey copy$default(io.ktor.util.AttributeKey,java.lang.String,io.ktor.util.reflect.TypeInfo,int,java.lang.Object); }', but not the descriptor class 'io.ktor.util.reflect.TypeInfo'
And the error:
Caused by: java.lang.IllegalArgumentException: Overflow of unsigned short value [131070]Jan
03/16/2025, 2:44 PMNiklas Wintrén
03/16/2025, 3:32 PM