You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With minifyEnabled set to true and com.android.tools.build:gradle version 8.0.2, Notificare launch fails because of a initialization error for the Internal Moshi instance; this is the stacktrace:
Failed to launch Notificare.
re.notifica.internal.network.NetworkException$ParsingException: Unable to parse JSON.
at re.notifica.internal.network.request.NotificareRequest$responseDecodable$2.invokeSuspend(NotificareRequest.kt:98)
at re.notifica.internal.network.request.NotificareRequest$responseDecodable$2.invoke(NotificareRequest.kt:0)
at re.notifica.internal.network.request.NotificareRequest$responseDecodable$2.invoke(NotificareRequest.kt:0)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at re.notifica.internal.network.request.NotificareRequest.responseDecodable(NotificareRequest.kt:90)
at re.notifica.internal.network.request.NotificareRequest$responseDecodable$1.invokeSuspend(NotificareRequest.kt:0)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: java.lang.IllegalArgumentException: Unexpected signature for public final org.json.JSONObject re.notifica.internal.moshi.JSONObjectAdapter.fromJson(com.squareup.moshi.JsonReader,com.squareup.moshi.JsonAdapter).
@FromJson method signatures may have one of the following structures:
<any access modifier> R fromJson(JsonReader jsonReader) throws <any>;
<any access modifier> R fromJson(JsonReader jsonReader, JsonAdapter<any> delegate, <any more delegates>) throws <any>;
<any access modifier> R fromJson(T value) throws <any>;
at com.squareup.moshi.AdapterMethodsFactory.fromAdapter(AdapterMethodsFactory.java:301)
at com.squareup.moshi.AdapterMethodsFactory.get(AdapterMethodsFactory.java:135)
at com.squareup.moshi.Moshi$Builder.add(Moshi.java:224)
at re.notifica.internal.MoshiKt$moshi$2.invoke(Moshi.kt:22)
at re.notifica.internal.MoshiKt$moshi$2.invoke(Moshi.kt:15)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at re.notifica.internal.MoshiKt.getMoshi(Moshi.kt:15)
at re.notifica.internal.network.request.NotificareRequest$responseDecodable$2.invokeSuspend(NotificareRequest.kt:92)
... 15 more
A workaround is downgrading AGP to version 7.4.2, changing gradle version doesn't seem to affect the issue.
I created a minimal GitHub project that reproduces the issue.
The text was updated successfully, but these errors were encountered:
There is a known issue with Moshi where it fails to keep the JsonAdapter classes when the application is built with R8 enabled. This is now enabled by default with Gradle 8.0.
You can refer to this Moshi issue for a suggested workaround.
In short, you can temporarily add the following Proguard rule to your app.
-keep,allowobfuscation,allowshrinking class com.squareup.moshi.JsonAdapter
Hi @hpinhal,
Thanks for the quick reply and for the Moshi issue reference/fix!
May I suggest updating the troubleshoot section of the integration guide or even the GitHub README.md with this information? It would have saved me a few hours of debugging.
With minifyEnabled set to true and com.android.tools.build:gradle version 8.0.2, Notificare launch fails because of a initialization error for the Internal Moshi instance; this is the stacktrace:
A workaround is downgrading AGP to version 7.4.2, changing gradle version doesn't seem to affect the issue.
I created a minimal GitHub project that reproduces the issue.
The text was updated successfully, but these errors were encountered: