我在更新到 installreferrer 库 v2.0 时遇到了这个问题。LINK
因此,当我调用库的startConnection
方法时,它会抛出:
Process: com.tomatedigital.lottogram, PID: 13424
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/aidl/BaseStub;
at com.android.installreferrer.api.InstallReferrerClientImpl.startConnection(InstallReferrerClientImpl.java:36)
at com.tomatedigital.lottogram.app.App.saveReferralInfo(App.java:221)
at com.tomatedigital.lottogram.app.App.onCreate(App.java:102)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
我认为这是库中的一个错误,因为如果您降级到以前的版本,它会很好用。我想避免这种崩溃。
我尝试用以下代码包装代码:
catch(Throwable ignore){}
但它一直在崩溃。我怎样才能优雅地处理这个错误?