所以我第一次将我的应用程序上传到Google Play商店(在Alpha中)。
但是当我安装并打开应用程序时,它会崩溃。但是如果我只是通过Android Studio运行它就可以了。
这是Firebase崩溃报告导致崩溃的错误:
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
android.support.design.widget.CoordinatorLayout.onLayout (CoordinatorLayout.java)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.support.v4.widget.DrawerLayout.onLayout (DrawerLayout.java)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.widget.FrameLayout.layoutChildren (FrameLayout.java:323)
android.widget.FrameLayout.onLayout (FrameLayout.java:261)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.widget.LinearLayout.setChildFrame (LinearLayout.java:1741)
android.widget.LinearLayout.layoutVertical (LinearLayout.java:1585)
android.widget.LinearLayout.onLayout (LinearLayout.java:1494)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.widget.FrameLayout.layoutChildren (FrameLayout.java:323)
android.widget.FrameLayout.onLayout (FrameLayout.java:261)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.widget.LinearLayout.setChildFrame (LinearLayout.java:1741)
android.widget.LinearLayout.layoutVertical (LinearLayout.java:1585)
android.widget.LinearLayout.onLayout (LinearLayout.java:1494)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.widget.FrameLayout.layoutChildren (FrameLayout.java:323)
android.widget.FrameLayout.onLayout (FrameLayout.java:261)
com.android.internal.policy.DecorView.onLayout (DecorView.java:818)
android.view.View.layout (View.java:18793)
android.view.ViewGroup.layout (ViewGroup.java:5952)
android.view.ViewRootImpl.performLayout (ViewRootImpl.java:2625)
android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2341)
android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1493)
可能导致此错误的原因是什么?如果在此错误中没有列出任何类,我怎么能推断出问题是什么?
答案 0 :(得分:0)
找到解决方案:
我正在使用Retrofit以及一些POJO模型类。我需要将以下行添加到proguard-rules.pro
文件中:
-keep class package.to.models.** { *; }