gpt4 book ai didi

android - NoSuchMethodError Lcom/google/gson/Gson;根据改造响应

转载 作者:行者123 更新时间:2023-11-29 02:27:09 26 4
gpt4 key购买 nike

所以,我的应用已经发布了将近一年,但没有看到这个问题,现在它出现了。
即使是现在,我的手机上的调试版本也没有这个问题。我对从 Android Studio 打开的任何模拟器没有任何问题。然而,Google Developer Console 中的预启动报告中的几乎所有模拟器在收到 Retrofit 响应时都会因此 NoSuchMethodError 而崩溃。

FATAL EXCEPTION: ControllerMessenger
Process: xxxxxxx, PID: 25090
java.lang.NoSuchMethodError: No direct method <init>(Lcom/google/gson/Gson;)V in class Lcom/google/gson/Gson$1; or its super classes (declaration of 'com.google.gson.Gson$1' appears in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk)
at com.google.gson.Gson.doubleAdapter(Gson.java:278)
at com.google.gson.Gson.<init>(Gson.java:217)
at com.google.gson.Gson.<init>(Gson.java:174)
at retrofit2.converter.gson.GsonConverterFactory.create(GsonConverterFactory.java:42)
at xxxxxxx.MtbActivity.loadJSON(MtbActivity.java:149)
at xxxxxxx.MtbActivity.onCreate(MtbActivity.java:135)
at android.app.Activity.performCreate(Activity.java:6013)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2466)
at android.app.ActivityThread.access$1200(ActivityThread.java:152)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341)
at android.os.Handler.dispatchMessage(Handler.java:102)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:142)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:134)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:114)
at androidx.test.espresso.action.Tap$1.b(Tap.java:6)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:78)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:94)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5538)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

我尝试过的:

  1. 将 Retrofit 和 Gson 依赖项更新到最新版本。
  2. 使缓存无效并重新启动
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

最佳答案

感谢彼得 here

总结:

现有的爬虫是FUBAR。作为解决方法,您可以通过选择退出新发布的爬虫来返回到以前版本的爬虫。

退出的方法如下:

登录您的 Play 管理中心。选择一个应用程序。选择发布管理 > 发布前报告 > 设置。在“发布前报告版本”部分,将退出开关向右移动,直到它变成蓝色。此后,启动报告再次正确显示。

关于android - NoSuchMethodError Lcom/google/gson/Gson;根据改造响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51557749/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com