-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected signature after migrating to KSP #1720
Comments
without a repro sample this isn't super actionable, looks like you're using proguard or R8 and unsure what configs you have there to protect them |
Hi @FilippoVigani! Did you manage to solve this somehow? I have the same issue... |
Unfortunately no, the easier route for me was to switch to kotlinx serialization which in my case was already used elsewhere in the project |
I've fixed the issue with this proguard rule:
Seems that needs to be added to |
I had the same problem on KSP Here's the problematic adapter import android.icu.util.Currency
import androidx.annotation.Keep
import com.squareup.moshi.FromJson
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.ToJson
class CurrencyAdapter {
@Keep
data class CurrencyProxy(
val shortName: String,
)
@FromJson
fun fromJson(
jsonReader: JsonReader,
delegate: JsonAdapter<CurrencyProxy>,
): Currency = Currency.getInstance(delegate.fromJson(jsonReader)!!.shortName)
@ToJson
fun toJson(
jsonWriter: JsonWriter,
value: Currency,
delegate: JsonAdapter<CurrencyProxy>,
) {
delegate.toJson(jsonWriter, CurrencyProxy(value.currencyCode))
}
} |
I believe this is the same issue referenced in #1663 |
I have a runtime crash that happens after migrating to KSP (and upgrading from 1.13.0 to 1.14.0) and it only happens in the release build (R8 enabled). I'm also using moshi kotlin codegen.
These are my adapters:
I also tried removing
@JvmSuppressWildcards
, thinking that maybe it's no longer needed for ksp, but the issue still occurs.The text was updated successfully, but these errors were encountered: