Code Monkey home page Code Monkey logo

recovery's Introduction

Recovery

A crash recovery framework!


Download build License

中文文档

Introduction

Blog entry with introduction

“Recovery” can help you to automatically handle application crash in runtime. It provides you with following functionality:

  • Automatic recovery activity with stack and data;
  • Ability to recover to the top activity;
  • A way to view and save crash info;
  • Ability to restart and clear the cache;
  • Allows you to do a restart instead of recovering if failed twice in one minute.

Art

recovery

Usage

Installation

Using Gradle

    implementation 'com.zxy.android:recovery:1.0.0'

or

    debugImplementation 'com.zxy.android:recovery:1.0.0'
    releaseImplementation 'com.zxy.android:recovery-no-op:1.0.0'

Using Maven

<dependency>
  	<groupId>com.zxy.android</groupId>
  	<artifactId>recovery</artifactId>
  	<version>1.0.0</version>
  	<type>pom</type>
</dependency>

Initialization

You can use this code sample to initialize Recovery in your application:

        Recovery.getInstance()
                .debug(true)
                .recoverInBackground(false)
                .recoverStack(true)
                .mainPage(MainActivity.class)
                .recoverEnabled(true)
                .callback(new MyCrashCallback())
                .silent(false, Recovery.SilentMode.RECOVER_ACTIVITY_STACK)
                .skip(TestActivity.class)
                .init(this);

If you don't want to show the RecoveryActivity when the application crash in runtime,you can use silence recover to restore your application.

You can use this code sample to initialize Recovery in your application:

        Recovery.getInstance()
                .debug(true)
                .recoverInBackground(false)
                .recoverStack(true)
                .mainPage(MainActivity.class)
                .recoverEnabled(true)
                .callback(new MyCrashCallback())
                .silent(true, Recovery.SilentMode.RECOVER_ACTIVITY_STACK)
                .skip(TestActivity.class)
                .init(this);

If you only need to display 'RecoveryActivity' page in development to obtain the debug data, and in the online version does not display, you can set up recoverEnabled(false);

Arguments

Argument Type Function
debug boolean Whether to open the debug mode
recoverInBackgroud boolean When the App in the background, whether to restore the stack
recoverStack boolean Whether to restore the activity stack, or to restore the top activity
mainPage Class<? extends Activity> Initial page activity
callback RecoveryCallback Crash info callback
silent boolean,SilentMode Whether to use silence recover,if true it will not display RecoveryActivity and restore the activity stack automatically

SilentMode

  1. RESTART - Restart App
  2. RECOVER_ACTIVITY_STACK - Restore the activity stack
  3. RECOVER_TOP_ACTIVITY - Restore the top activity
  4. RESTART_AND_CLEAR - Restart App and clear data

Callback

public interface RecoveryCallback {

    void stackTrace(String stackTrace);

    void cause(String cause);

    void exception(
    	String throwExceptionType,
    	String throwClassName,
    	String throwMethodName,
    	int throwLineNumber
    );
    
    void throwable(Throwable throwable);
}

Custom Theme

You can customize UI by setting these properties in your styles file:

    <color name="recovery_colorPrimary">#2E2E36</color>
    <color name="recovery_colorPrimaryDark">#2E2E36</color>
    <color name="recovery_colorAccent">#BDBDBD</color>
    <color name="recovery_background">#3C4350</color>
    <color name="recovery_textColor">#FFFFFF</color>
    <color name="recovery_textColor_sub">#C6C6C6</color>

Crash File Path

{SDCard Dir}/Android/data/{packageName}/files/recovery_crash/


Update history

  • VERSION-0.0.5——Support silent recovery
  • VERSION-0.0.6——Strengthen the protection of silent restore mode
  • VERSION-0.0.7——Add confusion configuration
  • VERSION-0.0.8——Add the skip Activity features,method:skip()
  • VERSION-0.0.9——Update the UI and solve some problems
  • VERSION-0.1.0——Optimization of crash exception delivery, initial Recovery framework can be in any position, release the official version-0.1.0
  • VERSION-0.1.3——Add 'no-op' support
  • VERSION-0.1.4——update default theme
  • VERSION-0.1.5——fix 8.0+ hook bug
  • VERSION-0.1.6——update
  • VERSION-1.0.0——Fix 8.0 compatibility issue

About

LICENSE

   Copyright 2016 zhengxiaoyong

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

recovery's People

Contributors

addvilz avatar sunzxyong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

recovery's Issues

点击清空缓存并重启应用的时候app一直奔溃

以下是你在清空缓存的时候的日志

 E/Recovery: slice-slice_9-classes.dex delete success!
10-09 11:13:22.557 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-support-annotations-24.2.0_5a9dbf2826c2e8ede6e3fe3707e72036fb2d3eaa-classes.dex delete success!
10-09 11:13:22.558 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_8-classes.dex delete success!
10-09 11:13:22.559 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_7-classes.dex delete success!
10-09 11:13:22.559 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_6-classes.dex delete success!
10-09 11:13:22.559 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_5-classes.dex delete success!
10-09 11:13:22.560 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_4-classes.dex delete success!
10-09 11:13:22.560 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_3-classes.dex delete success!
10-09 11:13:22.561 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_2-classes.dex delete success!
10-09 11:13:22.561 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_1-classes.dex delete success!
10-09 11:13:22.561 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_0-classes.dex delete success!
10-09 11:13:22.561 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_f3ada111e6bc1cdc08ad200f4ef2a809d1e10c9e-classes.dex delete success!
10-09 11:13:22.562 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_f27703e81145620e952de8dba46bdd27bd30a81b-classes.dex delete success!
10-09 11:13:22.562 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_cb3f49a4abbb6e1b576c2e319604d8ddc0707c02-classes.dex delete success!
10-09 11:13:22.562 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_6954d58f06d6c2aa8d306dc850540762a75c747b-classes.dex delete success!
10-09 11:13:22.562 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_29afaf939f2a5589aafbd5b8b7b3134158285bf8-classes.dex delete success!
10-09 11:13:22.562 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-vector-drawable-24.2.0_77f5062caea030a91c3c08d95554834ff5b12f14-classes.dex delete success!
10-09 11:13:22.563 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-v4-24.2.0_ea32c5302a72baeda4039dedf01bcbab66157b66-classes.dex delete success!
10-09 11:13:22.563 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-media-compat-24.2.0_d51a0cd4f0029bedd5f49afc4c1e854ad5a7b320-classes.dex delete success!
10-09 11:13:22.563 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-fragment-24.2.0_1ade706806d386a7ff873119023d2d6031e44ddc-classes.dex delete success!
10-09 11:13:22.563 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-core-utils-24.2.0_d0d1d5bff91636da1c74ce2eb56194d4bdb5ab5e-classes.dex delete success!
10-09 11:13:22.564 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-core-ui-24.2.0_5796e4dbe4151db411f2fb8149603fff5c5dcc33-classes.dex delete success!
10-09 11:13:22.564 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-compat-24.2.0_c72e5c683378ec2d4f7902c0734b60a0139d1fcc-classes.dex delete success!
10-09 11:13:22.564 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-recyclerview-v7-24.2.0_7f52a64cf83257c9eaf0cdb4b4ce6ac6f8d0660d-classes.dex delete success!
10-09 11:13:22.564 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-design-24.2.0_d4335ab3dcde9dda0866d0488a23aa5b8029c3c5-classes.dex delete success!
10-09 11:13:22.564 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-appcompat-v7-24.2.0_91248059aeb0ce5fb6363662dda30b413f981e4e-classes.dex delete success!
10-09 11:13:22.565 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-animated-vector-drawable-24.2.0_01cd59bc7519ab4eeba87fc80884c59f3126a47a-classes.dex delete success!
10-09 11:13:22.565 4581-4581/com.zxy.recovery.test:recover E/Recovery: com.android.opengl.shaders_cache delete success!
10-09 11:13:22.571 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-compat-24.2.0_c72e5c683378ec2d4f7902c0734b60a0139d1fcc-classes.dex delete success!
10-09 11:13:22.572 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-core-ui-24.2.0_5796e4dbe4151db411f2fb8149603fff5c5dcc33-classes.dex delete success!
10-09 11:13:22.576 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-appcompat-v7-24.2.0_91248059aeb0ce5fb6363662dda30b413f981e4e-classes.dex delete success!
10-09 11:13:22.576 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-support-annotations-24.2.0_5a9dbf2826c2e8ede6e3fe3707e72036fb2d3eaa-classes.dex delete success!
10-09 11:13:22.577 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-core-utils-24.2.0_d0d1d5bff91636da1c74ce2eb56194d4bdb5ab5e-classes.dex delete success!
10-09 11:13:22.577 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_29afaf939f2a5589aafbd5b8b7b3134158285bf8-classes.dex delete success!
10-09 11:13:22.578 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_6954d58f06d6c2aa8d306dc850540762a75c747b-classes.dex delete success!
10-09 11:13:22.580 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-animated-vector-drawable-24.2.0_01cd59bc7519ab4eeba87fc80884c59f3126a47a-classes.dex delete success!
10-09 11:13:22.580 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_cb3f49a4abbb6e1b576c2e319604d8ddc0707c02-classes.dex delete success!
10-09 11:13:22.582 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-recyclerview-v7-24.2.0_7f52a64cf83257c9eaf0cdb4b4ce6ac6f8d0660d-classes.dex delete success!
10-09 11:13:22.584 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-vector-drawable-24.2.0_77f5062caea030a91c3c08d95554834ff5b12f14-classes.dex delete success!
10-09 11:13:22.584 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-design-24.2.0_d4335ab3dcde9dda0866d0488a23aa5b8029c3c5-classes.dex delete success!
10-09 11:13:22.585 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-media-compat-24.2.0_d51a0cd4f0029bedd5f49afc4c1e854ad5a7b320-classes.dex delete success!
10-09 11:13:22.586 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-v4-24.2.0_ea32c5302a72baeda4039dedf01bcbab66157b66-classes.dex delete success!
10-09 11:13:22.586 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_f3ada111e6bc1cdc08ad200f4ef2a809d1e10c9e-classes.dex delete success!
10-09 11:13:22.587 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_4-classes.dex delete success!
10-09 11:13:22.588 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-com.android.support-support-fragment-24.2.0_1ade706806d386a7ff873119023d2d6031e44ddc-classes.dex delete success!
10-09 11:13:22.588 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_3-classes.dex delete success!
10-09 11:13:22.588 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_6-classes.dex delete success!
10-09 11:13:22.589 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_5-classes.dex delete success!
10-09 11:13:22.589 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_8-classes.dex delete success!
10-09 11:13:22.589 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_7-classes.dex delete success!
10-09 11:13:22.590 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_9-classes.dex delete success!
10-09 11:13:22.590 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-internal_impl-24.2.0_f27703e81145620e952de8dba46bdd27bd30a81b-classes.dex delete success!
10-09 11:13:22.591 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_0-classes.dex delete success!
10-09 11:13:22.592 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_2-classes.dex delete success!
10-09 11:13:22.592 4581-4581/com.zxy.recovery.test:recover E/Recovery: slice-slice_1-classes.dex delete success!
10-09 11:13:22.592 4581-4581/com.zxy.recovery.test:recover E/Recovery: recovery_info.xml delete success!

发现你是这么获取到file

 private static File getDataDir() {
        return new File(File.separator + "data" + File.separator + "data" + File.separator + Recovery.getInstance().getContext().getPackageName());
    }

string translation

default language for some strings is chinese, but should be english, and chinese strings should be in a separate strings.xml file

Hi,clearAppData would crash

when i click clearAppData button,your sample app will crash,and the crash log:

Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.zxy.recovery.test.App

应增加重启次数选项,达到设定的重启次数时回调做某些操作

  1. 应该增加重启次数选项,达到设定的重启次数时回调做某些操作,例如跳转网页重新下载app,或者邮件反馈,自动贴上报错以及相关机型,系统信息。(这应该自定义最好有默认操作)。
  2. 如果在开启了静默重启,切好app刚进入就抛出异常,就会无限重启,这应该属于bug。

静默恢复不起作用

你好 问一个在使用中的问题,在react-native中使用 开启debug弹窗 点击恢复可以重新打开界面 但是使用静默恢复不行 是因为错误是javascript的错 所以不执行重启?

Android8.0上 静默恢复失效

Crash log

07-25 21:06:58.478 18718-18718/? W/System.err: java.lang.IllegalAccessException: java.lang.Class<com.android.internal.os.RuntimeInit$UncaughtHandler> is not accessible from java.lang.Class<com.zxy.recovery.c.a>
07-25 21:06:58.479 18718-18718/? W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at com.zxy.recovery.c.a.a(MyApplication:26)
at com.zxy.recovery.c.a.a(MyApplication:37)
at com.zxy.recovery.core.c.uncaughtException(MyApplication:99)
at com.tencent.bugly.crashreport.crash.f.b(MyApplication:354)
at com.tencent.bugly.crashreport.crash.f.uncaughtException(MyApplication:372)
at com.amap.api.a.a.iv.uncaughtException(Unknown Source)
at com.amap.api.a.a.jm.uncaughtException(Unknown Source)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
07-25 21:06:58.651 19636-19636/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.plusmoney.managerplus:recover, PID: 19636
java.lang.RuntimeException: Unable to start service com.zxy.recovery.core.RecoveryService@c36d447 with Intent { cmp=com.plusmoney.managerplus/com.zxy.recovery.core.RecoveryService (has extras) }: com.zxy.recovery.b.a: The context is not initialized
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3495)
at android.app.ActivityThread.-wrap23(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1674)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Caused by:

我们为应用的正式版开启了静默恢复,结果不生效;在开发版上使用非静默恢复是生效的。
代码如下:

Recovery.getInstance()
.debug(IS_DEV)
//开发版开启调试页面,生产版启用静默恢复
.silent(!IS_DEV, Recovery.SilentMode.RECOVER_TOP_ACTIVITY)
.recoverInBackground(false)
.init(appContext);

这个应该与Android8.0的Service机制相关吧?

在 Android 8.0 之前,创建前台服务的方式通常是先创建一个后台服务,然后将该服务推到前台。
Android 8.0 有一项复杂功能;系统不允许后台应用创建后台服务。 因此,Android 8.0 引入了一种全新的方法,即 Context.startForegroundService(),以在前台启动新服务。
在系统创建服务后,应用有五秒的时间来调用该服务的 startForeground() 方法以显示新服务的用户可见通知。
如果应用在此时间限制内未调用 startForeground(),则系统将停止服务并声明此应用为 ANR。

关于RecoveryHandler killProcess的疑问

@Sunzxyong 你好

RecoveryHandler里面的killProcess方法调用了:

android.os.Process.killProcess(android.os.Process.myPid());

System.exit(10);// 实际是调用了Runtime.getRuntime().exit

起到杀进程的作用,为什么不直接调用Runtime.getRuntime().exit(10)呢?

讨论:多进程下,由于进程内存是独立,维护的Activity栈会出现问题

Hi,你好。看了你的源码,觉得这个框架写得很棒,但是发现多进程下会出现问题。

因为每个进程内存都是独立的,无法把不同进程的Activity放到同一个List里。所以在恢复Activity任务栈时会出现问题。

想了下,暂时只想到一个不是很优雅的方法:对这个Activty列表写入到本地来保存,实现跨进程共享。

没做代码验证,希望能与大家讨论出更好的方法,谢谢~

MIUI 9 上测试无法跳到恢复界面

Demo代码运行也一样,不会崩溃。界面无响应提示关闭。
不使用本库直接崩溃。
补充下:
测试三星华为部分机型没问题。

ReadMe的问题

在英文版上:RESTART_AND_CLEAR - Restart App and clear data
在中文版上:重启应用并清空缓存数据
如果是清空缓存的话,英文应该是用cache吧?这个好像有点古怪

在英文版上静默模式的说明代码里面,silent是true的,但在中文文档里面却写成了false,这个是不是写错了?
在函数的说明文档上,并没有说明skip函数的作用,只有在更新日志里面说明了这个函数的作用。
RecoveryCallBack的函数说明用法,而且throwable不是包含了大部分信息,为什么还要分开这么多个函数?

Unable to resolve dependency for ':app@debug/compileClasspath'

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.zxy.android:recovery:0.1.4.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.zxy.android:recovery:0.1.4.
Open File
Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.zxy.android:recovery:0.1.4.
Open File
Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.zxy.android:recovery:0.1.4.
Open File
Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.zxy.android:recovery:0.1.4.
Open File
Show Details

crash when click sure to restart and clear

FATAL EXCEPTION: main
Process: com.zxy.recovery.test, PID: 8593
java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.zxy.recovery.test.App
at android.app.LoadedApk.makeApplication(LoadedApk.java:587)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4792)
at android.app.ActivityThread.access$1900(ActivityThread.java:158)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1426)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5564)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.zxy.recovery.test.App
at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:219)
at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:238)
at android.app.Application.attach(Application.java:187)
at android.app.Instrumentation.newApplication(Instrumentation.java:996)
at android.app.Instrumentation.newApplication(Instrumentation.java:980)
at android.app.LoadedApk.makeApplication(LoadedApk.java:582)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4792) 
at android.app.ActivityThread.access$1900(ActivityThread.java:158) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1426) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5564) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
Caused by: java.lang.ClassNotFoundException: com.zxy.recovery.test.App
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:207)
at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:238) 
at android.app.Application.attach(Application.java:187) 
at android.app.Instrumentation.newApplication(Instrumentation.java:996) 
at android.app.Instrumentation.newApplication(Instrumentation.java:980) 
at android.app.LoadedApk.makeApplication(LoadedApk.java:582) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4792) 
at android.app.ActivityThread.access$1900(ActivityThread.java:158) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1426) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5564) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.zxy.recovery.test.App" on path: DexPathList[[zip file "/data/app/com.zxy.recovery.test-2/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:308) 
at java.lang.Class.forName(Class.java:272) 
at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:207) 
at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:238) 
at android.app.Application.attach(Application.java:187) 
at android.app.Instrumentation.newApplication(Instrumentation.java:996) 
at android.app.Instrumentation.newApplication(Instrumentation.java:980) 
at android.app.LoadedApk.makeApplication(LoadedApk.java:582) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4792) 
at android.app.ActivityThread.access$1900(ActivityThread.java:158) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1426) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5564) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
Suppressed: java.lang.ClassNotFoundException: com.zxy.recovery.test.App
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 20 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

崩溃日志显示问题

请问,在使用框架后,崩溃日志是不是只能在手机端显示,Android studio里的logcat就不在显示了?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.