我该如何解决App不断停止的问题?

时间:2019-05-16 11:42:05

标签: android

我的应用不断停止

05/16 16:59:47: Launching app
$ adb install-multiple -r -t C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_9.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_8.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\dep\dependencies.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_1.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_6.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_7.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_0.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_5.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_2.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_3.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\split-apk\debug\slices\slice_4.apk C:\Users\hp\AndroidStudioProjects\Shallo_app\app\build\intermediates\instant-run-apk\debug\app-debug.apk 
Split APKs installed in 3 s 401 ms
$ adb shell am start -n "com.example.shallo_app/com.example.shallo_app.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Connected to process 23913 on device panasonic-eluga_i2_activ-VCGANVZ98S6DPZK7
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/System: ClassLoader referenced unknown path: /data/app/com.example.shallo_app-2/lib/arm64
I/art: Starting a blocking GC HeapTrim
I/InstantRun: starting instant run server: is main process
W/art: Verification of java.lang.Object com.example.shallo_app.MainActivity.access$super(com.example.shallo_app.MainActivity, java.lang.String, java.lang.Object[]) took 126.812ms
I/art: Enter while loop.
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
        at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341)
        at void android.support.v7.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62)
        at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
        at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
        at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:645)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:787)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:727)
        at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:858)
        at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:821)
        at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:518)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:426)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:377)
        at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:607)
        at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
I/art:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
        at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
        at void com.example.shallo_app.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:35)
        at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6666)
        at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1118)
        at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2677)
        at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2789)
        at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
        at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1527)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:110)
        at void android.os.Looper.loop() (Looper.java:203)
        at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6251)
        at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
        at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1063)
        at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:924)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.shallo_app-2/base.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.shallo_app-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[
        at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
        at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341)
        at void android.support.v7.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62)
        at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
        at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
        at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:645)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:787)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:727)
        at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:858)
        at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:821)
        at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:518)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:426)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:377)
        at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:607)
        at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
        at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
        at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
        at void com.example.shallo_app.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:35)
        at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6666)
        at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1118)
        at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2677)
        at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2789)
        at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
        at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1527)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:110)
        at void android.os.Looper.loop() (Looper.java:203)
        at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6251)
        at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
        at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1063)
        at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:924)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.shallo_app, PID: 23913
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.shallo_app/com.example.shallo_app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.ViewStub.inflate()' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:203)
        at android.app.ActivityThread.main(ActivityThread.java:6251)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.ViewStub.inflate()' on a null object reference
        at com.example.shallo_app.MainActivity.onCreate(MainActivity.java:40)
        at android.app.Activity.performCreate(Activity.java:6666)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789) 
        at android.app.ActivityThread.-wrap12(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) 
        at android.os.Handler.dispatchMessage(Handler.java:110) 
        at android.os.Looper.loop(Looper.java:203) 
        at android.app.ActivityThread.main(ActivityThread.java:6251) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) 
Application terminated.

0 个答案:

没有答案