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

本文涉及的产品
云原生大数据计算服务 MaxCompute,5000CU*H 100GB 3个月
云原生大数据计算服务MaxCompute,500CU*H 100GB 3个月
日志服务 SLS,月写入数据量 50GB 1个月
简介: 一、背景最近维护公司的大数据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;
相关文章
|
2月前
|
安全 Java 网络安全
Android远程连接和登录FTPS服务代码(commons.net库)
Android远程连接和登录FTPS服务代码(commons.net库)
33 1
|
2月前
|
Linux API 开发工具
FFmpeg开发笔记(五十九)Linux编译ijkplayer的Android平台so库
ijkplayer是由B站研发的移动端播放器,基于FFmpeg 3.4,支持Android和iOS。其源码托管于GitHub,截至2024年9月15日,获得了3.24万星标和0.81万分支,尽管已停止更新6年。本文档介绍了如何在Linux环境下编译ijkplayer的so库,以便在较新的开发环境中使用。首先需安装编译工具并调整/tmp分区大小,接着下载并安装Android SDK和NDK,最后下载ijkplayer源码并编译。详细步骤包括环境准备、工具安装及库编译等。更多FFmpeg开发知识可参考相关书籍。
113 0
FFmpeg开发笔记(五十九)Linux编译ijkplayer的Android平台so库
|
2月前
|
Ubuntu Shell API
Ubuntu 64系统编译android arm64-v8a 的openssl静态库libssl.a和libcrypto.a
Ubuntu 64系统编译android arm64-v8a 的openssl静态库libssl.a和libcrypto.a
|
3月前
|
Java Android开发 C++
🚀Android NDK开发实战!Java与C++混合编程,打造极致性能体验!📊
在Android应用开发中,追求卓越性能是不变的主题。本文介绍如何利用Android NDK(Native Development Kit)结合Java与C++进行混合编程,提升应用性能。从环境搭建到JNI接口设计,再到实战示例,全面展示NDK的优势与应用技巧,助你打造高性能应用。通过具体案例,如计算斐波那契数列,详细讲解Java与C++的协作流程,帮助开发者掌握NDK开发精髓,实现高效计算与硬件交互。
168 1
|
4月前
|
编解码 测试技术 Android开发
Android经典实战之用 CameraX 库实现高质量的照片和视频拍摄功能
本文详细介绍了如何利用CameraX库实现高质量的照片及视频拍摄功能,包括添加依赖、初始化、权限请求、配置预览与捕获等关键步骤。此外,还特别针对不同分辨率和帧率的视频拍摄提供了性能优化策略,确保应用既高效又稳定。
428 1
Android经典实战之用 CameraX 库实现高质量的照片和视频拍摄功能
|
4月前
|
存储 搜索推荐 Java
探索安卓开发中的自定义视图:打造个性化UI组件Java中的异常处理:从基础到高级
【8月更文挑战第29天】在安卓应用的海洋中,一个独特的用户界面(UI)能让应用脱颖而出。自定义视图是实现这一目标的强大工具。本文将通过一个简单的自定义计数器视图示例,展示如何从零开始创建一个具有独特风格和功能的安卓UI组件,并讨论在此过程中涉及的设计原则、性能优化和兼容性问题。准备好让你的应用与众不同了吗?让我们开始吧!
|
4月前
|
监控 Java API
Android经典实战之OkDownload:一个经典强大的文件下载开源库,支持断点续传
本文介绍的 OkDownload 是一个专为 Android 设计的开源下载框架,支持多线程下载、断点续传和任务队列管理等功能,具备可靠性、灵活性和高性能特点。它提供了多种配置选项和监听器,便于开发者集成和扩展。尽管已多年未更新,但依然适用于大多数文件下载需求。
427 1
|
4月前
|
Java 调度 Android开发
Android经典实战之Kotlin的delay函数和Java中的Thread.sleep有什么不同?
本文介绍了 Kotlin 中的 `delay` 函数与 Java 中 `Thread.sleep` 方法的区别。两者均可暂停代码执行,但 `delay` 适用于协程,非阻塞且高效;`Thread.sleep` 则阻塞当前线程。理解这些差异有助于提高程序效率与可读性。
87 1
|
4月前
|
Android开发
Android Studio: 解决Gradle sync failed 错误
本文介绍了解决Android Studio中出现的Gradle同步失败错误的步骤,包括从`gradle-wrapper.properties`文件中获取Gradle的下载链接,手动下载Gradle压缩包,并替换默认下载路径中的临时文件,然后重新触发Android Studio的"Try Again"来完成同步。
1739 0
Android Studio: 解决Gradle sync failed 错误
|
4月前
|
API Android开发
Android项目架构设计问题之选择和使用合适的UI库如何解决
Android项目架构设计问题之选择和使用合适的UI库如何解决
54 0