我正在使用多模块应用程序,并且当minifyEnabled true
模块的build.gradle中的installed
时,该应用程序崩溃。
以下是我从Play控制台检索到的模糊的堆栈跟踪。
FATAL EXCEPTION: ControllerMessenger
Process: com.packagename, PID: 16978
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference
at com.packagename.login.Utils.AuthenticationActions.saveCredentials(AuthenticationActions.java)
at com.packagename.login.LoginActivity$1$1.onCompleted(LoginActivity.java)
at com.packagename.login.LoginActivity$1$1.onCompleted(LoginActivity.java)
at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.ion.IonRequestBuilder$EmitterTransform$1.onCompleted(IonRequestBuilder.java)
at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.ion.IonRequestBuilder$1.run(IonRequestBuilder.java)
at com.koushikdutta.async.AsyncServer$RunnableWrapper.run(AsyncServer.java)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:166)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:158)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:77)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:52)
at androidx.test.espresso.action.Tap.c(Tap.java:8)
at androidx.test.espresso.action.Tap.b(Tap.java:18)
at androidx.test.espresso.action.Tap$1.a(Tap.java:3)
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:79)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:96)
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:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5459)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
我无法理解此代码对应于'java.lang.Object java.util.List.get(int)'
我正在使用多个外部库,其中之一是 ion koush 。
我尝试将其添加到项目中的everguard-rules.pro文件中
-keep class com.koushikdutta.** { *;}
。但这并没有取得任何成功。
感谢您的帮助。
答案 0 :(得分:1)
还要在类名上方添加“ @Keep”到所有Pojo文件中。
答案 1 :(得分:1)
当您的应用将json转换为POJO并启用最小化时,就会发生这种情况。最小化那些使转换不可能的POJO的更改(它将编译,但是您所有的POJO属性将为空)。
保留将-keep class com.packagename.<path to pojos> {*; }
添加到您的proguard-rules文件中的POJO。