java.lang.NoSuchMethodError: No static method parseString
maheritdev opened this issue · 6 comments
maheritdev commented
when I use the library with java code to handle the bug of Android 12 and above I got this error when I open chucker to see the Api data
E/AndroidRuntime: FATAL EXCEPTION: main
Process: ats.jo.royal.patient.dev, PID: 24675
java.lang.NoSuchMethodError: No static method parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement; in class Lcom/google/gson/JsonParser;` or its super classes (declaration of 'com.google.gson.JsonParser' appears in /data/app/~~baRMxdN_LkhPazLLWRcmsQ==/ats.jo.royal.patient.dev-gxKSg1_qoEJETFmYV5aKCA==/base.apk!classes2.dex)
at com.chuckerteam.chucker.internal.support.FormatUtils.formatJson(FormatUtils.kt:57)
at com.chuckerteam.chucker.internal.data.entity.HttpTransaction.formatBody(HttpTransaction.kt:210)
at com.chuckerteam.chucker.internal.data.entity.HttpTransaction.getFormattedRequestBody(HttpTransaction.kt:223)
at com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment$processPayload$2.invokeSuspend(TransactionPayloadFragment.kt:226)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
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)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@b00062b, Dispatchers.Main.immediate]
cortinico commented
Which version of OkHTTP are you using?
It seems like this is related to square/retrofit#3058
maheritdev commented
I tried all of these solutions but with no benefits unfortunately. android version 12 and above
cortinico commented
Which version of OkHTTP are you using?
rayworks commented
Hi @maheritdev I've met the same issue before, pls make sure you're using the correct gson
version (>= 2.8.7) after integrating Chucker library. In my case, I have 2 different gson versions which caused the trouble.
hoangchungk53qx1 commented
any new, i faced i same issues