Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App crashes from signed APK but not Android studio

Tags:

android

My application runs just fine when installed from Android studio but as soon as I install and signed APK to any device the app will not run. Below is a crash dump from a friends device that was provided from the Google Play Developer Console. Obviously it has something to do with the layout but I'm not sure what is causing it in the release build but not while testing. No Errors show up when I'm testing it on my device and there are no errors in android studio. I'm fairly new to developing so I am not sure what to do. Any help or suggestions would be greatly appreciated.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.j.a.p/com.j.a.p.MainActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class android.support.design.widget.NavigationView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
        at android.app.ActivityThread.access$1100(ActivityThread.java:221)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:158)
        at android.app.ActivityThread.main(ActivityThread.java:7224)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class android.support.design.widget.NavigationView
        at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
        at android.support.v7.a.w.a(SourceFile:257)
        at android.support.v7.a.p.setContentView(SourceFile:109)
        at com.j.a.p.MainActivity.onCreate(SourceFile:31)
        at android.app.Activity.performCreate(Activity.java:6876)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
        ... 9 more
    Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class android.support.design.widget.NavigationView
        at android.view.LayoutInflater.createView(LayoutInflater.java:657)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
        ... 17 more
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at android.view.LayoutInflater.createView(LayoutInflater.java:631)
        ... 22 more
    Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.design.internal.NavigationMenuView
        at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
        at android.support.design.internal.c.a(SourceFile:97)
        at android.support.design.widget.NavigationView.<init>(SourceFile:165)
        at android.support.design.widget.NavigationView.<init>(SourceFile:94)
        ... 24 more
    Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.design.internal.NavigationMenuView
        at android.view.LayoutInflater.createView(LayoutInflater.java:657)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
        ... 28 more
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at android.view.LayoutInflater.createView(LayoutInflater.java:631)
        ... 31 more
    Caused by: java.lang.IllegalStateException: Binary XML file line #17: Error creating LayoutManager android.support.v7.widget.LinearLayoutManager
        at android.support.v7.widget.RecyclerView.a(SourceFile:540)
        at android.support.v7.widget.RecyclerView.<init>(SourceFile:485)
        at android.support.design.internal.NavigationMenuView.<init>(SourceFile:39)
        at android.support.design.internal.NavigationMenuView.<init>(SourceFile:35)
        ... 33 more
    Caused by: java.lang.NoSuchMethodException: <init> []
        at java.lang.Class.getConstructor(Class.java:528)
        at java.lang.Class.getConstructor(Class.java:492)
        at android.support.v7.widget.RecyclerView.a(SourceFile:537)
        ... 36 more
    Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet, int, int]
        at java.lang.Class.getConstructor(Class.java:528)
        at java.lang.Class.getConstructor(Class.java:492)
        at android.support.v7.widget.RecyclerView.a(SourceFile:532)
        ... 36 more
like image 905
Icarus Ridexx Avatar asked Sep 26 '16 04:09

Icarus Ridexx


People also ask

Why does my app keep crashing in Android Studio?

An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.

Why does my APK app keep crashing?

The Android apps crashing problem may happen if there is something wrong with the cache partition, which stores the App data and also other system files. To wipe the cache partition, you need to put your device into Android recovery mode.

How do you fix an app that keeps crashing without deleting it?

To fix Android apps that keep crashing: To do this, go to Settings and open Apps. Under Your apps, you'll see a list of the apps currently installed on your device. From the list, tap the app that keeps crashing and tap Force stop in the bottom right corner. Then try opening the app again.


1 Answers

Try deleting proguard directory in your project On any proguard files such as proguard-android.txt or proguard-rules.pro.

2nd option - try in your build.gradle file

 buildTypes {

        debug {
            minifyEnabled false

        }
        release {
            minifyEnabled false

        }
    }

Use any of the options or a combination of both

like image 56
nishith kumar Avatar answered Oct 21 '22 22:10

nishith kumar