【我的Android进阶之旅】解决sqlcipher库:java.lang.IllegalStateException: get field slot from row 0 col 0 failed.

简介: 一、背景最近维护公司的大数据SDK,在大数据SDK里面加入了ANR的监控功能,并将ANR的相关信息通过大数据埋点的方式记录到了数据库中,然后大数据上报的时候上报到大数据平台,这样就可以实现ANR性能的监控功能。

一、背景

最近维护公司的大数据SDK,在大数据SDK里面加入了ANR的监控功能,并将ANR的相关信息通过大数据埋点的方式记录到了数据库中,然后大数据上报的时候上报到大数据平台,这样就可以实现ANR性能的监控功能。

但是,最近看友盟的大数据平台错误上, 有一个是调用大数据SDK上报时,查询数据库出现的异常,异常错误信息如下所示:

java.lang.IllegalStateException: get field slot from row 0 col 0 failed
    at net.sqlcipher.CursorWindow.getString_native(Native Method)
    at net.sqlcipher.CursorWindow.getString(CursorWindow.java:385)
    at net.sqlcipher.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)
    at android.database.CursorWrapper.getString(CursorWrapper.java:137)
    at com.j256.ormlite.sqlcipher.android.AndroidDatabaseResults.getString(AndroidDatabaseResults.java:135)
    at com.j256.ormlite.field.types.StringType.resultToSqlArg(StringType.java:39)
    at com.j256.ormlite.field.BaseFieldConverter.resultToJava(BaseFieldConverter.java:24)
    at com.j256.ormlite.field.FieldType.resultToJava(FieldType.java:819)
    at com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:60)
    at com.j256.ormlite.stmt.SelectIterator.getCurrent(SelectIterator.java:270)
    at com.j256.ormlite.stmt.SelectIterator.nextThrow(SelectIterator.java:161)
    at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:202)
    at com.j256.ormlite.dao.BaseDaoImpl.query(BaseDaoImpl.java:265)
    at com.j256.ormlite.stmt.QueryBuilder.query(QueryBuilder.java:361)
    at com.xtc.data.database.OrmLiteDao.queryForPagesByOrder(OrmLiteDao.java:487)
    at com.xtc.bigdata.report.db.ReportDao.deleteByStatus(ReportDao.java:88)
    at com.xtc.bigdata.report.upload.ReportIntentService$1.onSuccess(ReportIntentService.java:84)
    at com.xtc.bigdata.report.upload.task.ReportTask$1.onResponse(ReportTask.java:121)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:760)

这里写图片描述

这个异常一下子就出现了 348次,影响了6个用户,有一款机型出现了316次, 里面将整个app的整体奔溃率拉高了。简直要命啊!

这里写图片描述

二、分析问题

猜测一、大数据SDK版本没更新

开始我以为是大数据SDK更新删除字段,增加字段后,没有升级大数据的数据库版本。但是之前发布的APP引用的大数据SDK的数据库版本为3,而刚刚发布的APP的大数据SDK的数据库版本为4,整体上数据库升级了,应该是没有问题的。

猜测二 、数据库查询的单条记录超过1MB

一开始,完全找不到原因,只能靠各种猜测,各种google,百度答案。查询到的有参考一样的链接如下所示:

其中有一段话,说的是
这里写图片描述

There’s a limit of 1MB on internal assets due to dynamic decompression; the 1MB limit also seems to apply to Cursor blobs but this doesn’t seem to be documented anywhere.

Generally you should avoid blobs in SQLite as they perform poorly; instead save the blob data as a file and store the location of the file in your DB.

1、分析抓取的日志

这里写图片描述

通过抓取到的日志信息来看,因为这个异常是发生在捕获到ANRException之后,触发了大数据SDK上报的操作而导致异常的。所以初步怀疑是ANR的堆栈信息太多导致查询数据库时候奔溃了。

2、一次性查询出来的多条信息超过1Mb是否会奔溃?

一开始我和另外一个同事进行压测,将拉取到的日志ANR异常日志的stackInfo循环500次插入数据库然后每200条取出来一次查询。这样一次性查询出来的多条信息查过了1Mb,但是完全没有奔溃一切正常。因此排除了一次性查询出来的多条信息超过1Mb是否会奔溃这个点。

3、一次性查询出来的单条信息超过1Mb是否会奔溃?

后来我又去测了一下,如果一条数据量超过1Mb会怎么样?测试结果是这个异常果断出现了。

测试方法如下:
点击某个按钮,执行下面的startTest() 方法,手动埋上一个ANRException,单挑的堆栈信息很大,测试代码是临时测试的。

private void startTest() {
        new Thread() {
            @Override
            public void run() {
                StringBuffer stack = new StringBuffer("[W][2018-01-30 +8.0 10:24:58.596][14396, 274][:][com.xtc.bigdata.monitor.anr.ANRMonitor, dumpBlockInfo, 48][stackTraceInfo:01-30 10:23:12.153\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:13.233\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:14.312\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:15.392\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:16.459\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:17.526\n" +
                        "com.xtc.widget.phone.view.IconCenterEditText.onFocusChange(IconCenterEditText.java:58)\n" +
                        "android.view.View.onFocusChanged(View.java:5216)\n" +
                        "android.widget.TextView.onFocusChanged(TextView.java:8032)\n" +
                        "android.view.View.clearFocusInternal(View.java:5099)\n" +
                        "android.view.View.unFocus(View.java:5132)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.requestChildFocus(ViewGroup.java:665)\n" +
                        "android.view.ViewGroup.requestChildFocus(ViewGroup.java:671)\n" +
                        "android.view.View.handleFocusGainInternal(View.java:4965)\n" +
                        "android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:645)\n" +
                        "android.view.View.requestFocusNoSearch(View.java:7688)\n" +
                        "android.view.View.requestFocus(View.java:7667)\n" +
                        "android.view.ViewGroup.requestFocus(ViewGroup.java:2629)\n" +
                        "android.view.View.requestFocus(View.java:7634)\n" +
                        "android.widget.TextView.onKeyUp(TextView.java:6022)\n" +
                        "android.view.KeyEvent.dispatch(KeyEvent.java:2701)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8426)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootI\n" +
                        "\n" +
                        "\n" +
                        "\n" +
                        "\n" +
                        "\n" +
                        "\n" +
                        "01-30 10:23:13.233\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:14.312\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:15.392\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:16.459\n" +
                        "com.xtc.watch.view.remoteadd.activity.MatchContactActivity$9.onKey(MatchContactActivity.java:503)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8416)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5899)\n" +
                        "android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3417)\n" +
                        "android.os.Handler.dispatchMessage(Handler.java:102)\n" +
                        "android.os.Looper.loop(Looper.java:135)\n" +
                        "android.app.ActivityThread.main(ActivityThread.java:5418)\n" +
                        "java.lang.reflect.Method.invoke(Native Method)\n" +
                        "java.lang.reflect.Method.invoke(Method.java:372)\n" +
                        "com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037)\n" +
                        "com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)\n" +
                        "\n" +
                        "01-30 10:23:17.526\n" +
                        "com.xtc.widget.phone.view.IconCenterEditText.onFocusChange(IconCenterEditText.java:58)\n" +
                        "android.view.View.onFocusChanged(View.java:5216)\n" +
                        "android.widget.TextView.onFocusChanged(TextView.java:8032)\n" +
                        "android.view.View.clearFocusInternal(View.java:5099)\n" +
                        "android.view.View.unFocus(View.java:5132)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.unFocus(ViewGroup.java:864)\n" +
                        "android.view.ViewGroup.requestChildFocus(ViewGroup.java:665)\n" +
                        "android.view.ViewGroup.requestChildFocus(ViewGroup.java:671)\n" +
                        "android.view.View.handleFocusGainInternal(View.java:4965)\n" +
                        "android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:645)\n" +
                        "android.view.View.requestFocusNoSearch(View.java:7688)\n" +
                        "android.view.View.requestFocus(View.java:7667)\n" +
                        "android.view.ViewGroup.requestFocus(ViewGroup.java:2629)\n" +
                        "android.view.View.requestFocus(View.java:7634)\n" +
                        "android.widget.TextView.onKeyUp(TextView.java:6022)\n" +
                        "android.view.KeyEvent.dispatch(KeyEvent.java:2701)\n" +
                        "android.view.View.dispatchKeyEvent(View.java:8426)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1507)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2479)\n" +
                        "com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1770)\n" +
                        "android.app.Activity.dispatchKeyEvent(Activity.java:2764)\n" +
                        "com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2372)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4128)\n" +
                        "android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4086)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3776)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3833)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3687)\n" +
                        "android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3647)\n" +
                        "android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3655)\n" +
                        "android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3621)\n" +
                        "android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5965)\n" +
                        "android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5939)\n" +
                        "android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.");

                for (int i =0 ;i <=5;i++){
                    stack.append(stack);
                }
                while (true) {
                    for (int i = 0;i < 1;i++) {
                        String stackString = new String(stack);
                        ANRException anrException = new ANRException(stackString);
                        ExceptionEvent exceptionEvent = new ExceptionEvent();
                        exceptionEvent.functionName = "ANR-ERROR-" + Constants.HOST_APP_ID;
                        exceptionEvent.reason = anrException.toString();
                        exceptionEvent.stack = stackString;
                        CollectionManager.getInstance().exceptionEvent(exceptionEvent);
                    }
                    try {
                        Thread.sleep(300000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
    }

然后果断的出现了异常,异常如下所示:

这里写图片描述

通过上面的测试,发现了这个crash的根本原因就是,单挑数据库的记录过大,导致查询的时候出现奔溃。

三、处理方法

3.1 将大数据SDK的ANR监控暂时屏蔽掉

,现有的ANR监控的堆栈信息太多,容易出问题。而且在我们进行压测的过程中,发现及时单条记录不超过1mb,但是多条记录过大的时候,http上报大数据的时候,http的请求的body过大也会导致请求失败,因此暂时将ANR监控的功能屏蔽掉。

3.2 对调用OrmLiteDao封装类的相关代码处加上 try/catch 处理

因为OrmLiteDao封装类里面,只捕获了SQL相关的异常,没有捕获其他类型的异常,所以出现的时候就会奔溃。

这里写图片描述

因为OrmLiteDao的封装类,我们在封装的时候只catch了sql操作习惯的异常,因此暂时在调用数据库操作的时候,在调用的地方加上 try/catch 捕获住刚才的IllegalStateException异常。

3.3 对 android-database-sqlcipher 进行升级

android-database-sqlcipher 这个项目中,

有人提了相同的Issue,链接如下所示:

https://github.com/sqlcipher/android-database-sqlcipher/issues/341#issuecomment-310289295

这里写图片描述

这里写图片描述

通过查看Issue的描述,发现和我们的这个crash类似。

然后我们将 net.zetetic:android-database-sqlcipher 库进行了升级。

一开始我们项目引用的版本为: net.zetetic:android-database-sqlcipher:3.5.4

这里写图片描述

单条数据太大的时候,就会奔溃

这里写图片描述

升级为 net.zetetic:android-database-sqlcipher:3.5.9
这里写图片描述

升级完成之后,重新编译APP,然后重新进行压测,发现这个crash不存在了。
这里写图片描述

四、总结

  • 不要在数据库中的单条数据插入太多的数据。
  • 通过升级net.zetetic:android-database-sqlcipher版本到3.5.9可以修复这个1MB的限制。

五、参考链接


这里写图片描述

作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!
转载请保留原文地址:http://blog.csdn.net/ouyang_peng/article/details/79228417

如果觉得本文对您有所帮助,欢迎您扫码下图所示的支付宝和微信支付二维码对本文进行随意打赏。您的支持将鼓励我继续创作!

这里写图片描述

相关实践学习
基于MaxCompute的热门话题分析
本实验围绕社交用户发布的文章做了详尽的分析,通过分析能得到用户群体年龄分布,性别分布,地理位置分布,以及热门话题的热度。
SaaS 模式云数据仓库必修课
本课程由阿里云开发者社区和阿里云大数据团队共同出品,是SaaS模式云原生数据仓库领导者MaxCompute核心课程。本课程由阿里云资深产品和技术专家们从概念到方法,从场景到实践,体系化的将阿里巴巴飞天大数据平台10多年的经过验证的方法与实践深入浅出的讲给开发者们。帮助大数据开发者快速了解并掌握SaaS模式的云原生的数据仓库,助力开发者学习了解先进的技术栈,并能在实际业务中敏捷的进行大数据分析,赋能企业业务。 通过本课程可以了解SaaS模式云原生数据仓库领导者MaxCompute核心功能及典型适用场景,可应用MaxCompute实现数仓搭建,快速进行大数据分析。适合大数据工程师、大数据分析师 大量数据需要处理、存储和管理,需要搭建数据仓库?学它! 没有足够人员和经验来运维大数据平台,不想自建IDC买机器,需要免运维的大数据平台?会SQL就等于会大数据?学它! 想知道大数据用得对不对,想用更少的钱得到持续演进的数仓能力?获得极致弹性的计算资源和更好的性能,以及持续保护数据安全的生产环境?学它! 想要获得灵活的分析能力,快速洞察数据规律特征?想要兼得数据湖的灵活性与数据仓库的成长性?学它! 出品人:阿里云大数据产品及研发团队专家 产品 MaxCompute 官网 https://www.aliyun.com/product/odps&nbsp;
相关文章
|
9天前
|
Java 开发者
Java一分钟之-Quasar:协程库
【6月更文挑战第12天】Quasar是Java的高性能协程库,通过字节码增强实现轻量级并发模型——协程和通道,降低并发处理的复杂性和资源消耗。本文探讨了Quasar的常见问题,如内存泄漏、死锁和过度使用,提出相应避免策略,并提供了一个简单的协程间数据交换的代码示例。正确使用Quasar能提升程序性能和可维护性。
26 1
|
3天前
|
安全 Java 编译器
Android面试题之Java 泛型和Kotlin泛型
**Java泛型是JDK5引入的特性,用于编译时类型检查和安全。泛型擦除会在运行时移除类型参数,用Object或边界类型替换。这导致几个限制:不能直接创建泛型实例,不能使用instanceof,泛型数组与协变冲突,以及在静态上下文中的限制。通配符如<?>用于增强灵活性,<? extends T>只读,<? super T>只写。面试题涉及泛型原理和擦除机制。
13 3
Android面试题之Java 泛型和Kotlin泛型
|
1天前
|
存储 Java 数据库连接
Android Java开发异步
【6月更文挑战第15天】
|
4天前
|
缓存 网络协议 Java
Android面试题之Java网络通信基础知识
Socket是应用与TCP/IP通信的接口,封装了底层细节。网络通信涉及连接、读写数据。BIO是同步阻塞,NIO支持多路复用(如Selector),AIO在某些平台提供异步非阻塞服务。BIO示例中,服务端用固定线程池处理客户端请求,客户端发起连接并读写数据。NIO的关键是Selector监控多个通道的事件,减少线程消耗。书中推荐《Java网络编程》和《UNIX网络编程》。关注公众号AntDream了解更多。
17 2
|
12天前
|
安全 Java Android开发
Kotlin与Java:Android开发的双剑合璧
【6月更文挑战第9天】Kotlin和Java在Android开发中形成互补态势。Java凭借广泛社区支持和丰富的类库资源占据主导,但其语法繁琐和空指针问题限制了发展。Kotlin,设计来解决这些问题,以其简洁、安全、高效的特性逐渐兴起。Kotlin的互操作性允许与Java无缝集成,提升开发效率,减少错误。两者结合提高了代码质量和开发者的灵活性,促进了Android开发社区的繁荣。开发者应把握这种&quot;双剑合璧&quot;,适应技术发展。
30 10
|
8天前
|
Java 编译器 Maven
Java一分钟之-AspectJ:AOP库
【6月更文挑战第13天】AspectJ是Java的AOP框架,扩展了语言并提供编译时和加载时织入,便于模块化横切关注点。关键概念包括编织、切面、切点和通知。常见问题涉及编译时织入配置、切点表达式误用、异常处理和版本兼容性。通过正确配置构建工具、精准设计切点、妥善处理异常和确保版本兼容,可避免这些问题。文中还提供了一个记录服务层方法执行时间的代码示例,帮助读者快速上手AspectJ。
28 2
|
8天前
|
数据采集 Java Linux
Java异常之【sun.security.validator.ValidatorException: PKIX path building failed: sun.security...】
Java异常之【sun.security.validator.ValidatorException: PKIX path building failed: sun.security...】
20 0
Java异常之【sun.security.validator.ValidatorException: PKIX path building failed: sun.security...】
|
10天前
|
监控 网络协议 Java
Java一分钟之-Netty:高性能异步网络库
【6月更文挑战第11天】Netty是Java的高性能异步网络框架,基于NIO,以其高吞吐量、低延迟、灵活性和安全性受到青睐。常见问题包括内存泄漏、ChannelHandler滥用和异常处理不当。要规避这些问题,需正确释放ByteBuf,精简ChannelPipeline,妥善处理异常,并深入理解Netty原理。通过代码审查、遵循最佳实践和监控日志,可提升代码质量和性能。掌握Netty,打造高效网络服务。
14 2
|
12天前
|
Java API 容器
Java 8 的流库:Filter、Map、FlatMap 及 Optional 的概念与用法
【6月更文挑战第9天】Java 8 引入了许多强大的新特性,其中流库(Stream API)和 Optional 类极大地简化了集合操作和空值处理。本文将深入探讨 filter、map、flatMap 以及 Optional 的概念和用法,并提供示例代码来展示其实际应用。
18 4
|
10天前
|
Prometheus 监控 Cloud Native
Java一分钟之-Micrometer:应用指标库
【6月更文挑战第11天】Micrometer是Java应用的度量库,提供统一API与多监控系统集成,如Prometheus、InfluxDB。它有标准化接口、广泛后端支持、自动配置和多种度量类型。常见问题包括度量命名不规范、数据过载和忽略维度。解决办法包括遵循命名规范、选择重要指标和使用标签。了解API、设计度量策略和选好监控系统是关键。通过正确使用Micrometer,可建立高效监控体系,保障应用稳定性和性能。
22 1