Skip to content
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

java.lang.NoSuchMethodError: No static method parseString #902

Open
maheritdev opened this issue Oct 3, 2022 · 6 comments
Open

java.lang.NoSuchMethodError: No static method parseString #902

maheritdev opened this issue Oct 3, 2022 · 6 comments

Comments

@maheritdev
Copy link

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
Copy link
Member

Which version of OkHTTP are you using?
It seems like this is related to square/retrofit#3058

@maheritdev
Copy link
Author

I tried all of these solutions but with no benefits unfortunately. android version 12 and above

@cortinico
Copy link
Member

Which version of OkHTTP are you using?

@rayworks
Copy link
Contributor

rayworks commented Jan 5, 2023

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
Copy link

any new, i faced i same issues

@moontide
Copy link

One case of mine (not on Android though): closure-compiler.jar contains another version of gson (probably an older one) caused this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants