Android应用程序崩溃,但没有有用的堆栈跟踪

6
在发布之前的测试过程中,这个应用程序表现良好。我们在几个设备上进行了测试,没有发现任何问题。但是一旦应用程序上传到Play商店后,我们的一个用户开始抱怨应用程序在其中一个标签页崩溃。尽管如此,崩溃率约为90%,不是一致性的。
大多数情况下,它会在某个屏幕上崩溃,但有时也会在用户登录后不执行任何操作的情况下立即崩溃。
我们使用Crashlytics记录崩溃,但我们没有收到任何报告。
我设法与用户交谈,并在他的计算机上设置了Android Studio并查看了未经过滤的logcat。我找不到任何有用的错误。(由于他不是技术人员,我使用了远程桌面)
我们团队的一名成员将手机更新到Android 6.0.1后,也开始出现相同的问题。因此,我认为它可能与此有关。
我认为它可能是ANR,但它没有冻结,在traces.txt文件中也没有关于我们的应用程序的任何内容。 我认为它是OutOfMemoryError(或类似的错误),但没有成功证明。
我请几位拥有Android 6.0.1的朋友进行测试,除了一个使用Nexus 6P的朋友,他们中的所有人都遇到了同样的问题。
这是我收到的logcat(没有过滤器):
5-03 16:57:05.397 3985-3985/? I/Keyboard.Facilitator: onFinishInput()
05-03 16:57:05.461 3329-3329/? I/GoogleHttpClient: GMS http client unavailable, use old client
05-03 16:57:05.528 31675-32471/com.helloheart.app.healthplan.debug D/OpenGLRenderer: endAllActiveAnimators on 0xb7b815c8 (RippleDrawable) with handle 0xb8164b78
05-03 16:57:05.537 3329-3351/? I/[@@    ] SyncAdapterProxy: Delagator disabled, using the (deprecated) GData sync adapter
05-03 16:57:05.539 3329-3351/? I/GoogleHttpClient: GMS http client unavailable, use old client
05-03 16:57:05.668 31675-3348/com.helloheart.app.healthplan.debug V/Localytics: Analytics upload complete with status 202
05-03 16:57:05.670 31675-32420/com.helloheart.app.healthplan.debug V/Localytics: Analytics handler received { when=-2ms what=4 obj=[Ljava.lang.Object;@1f24709 target=com.localytics.android.AnalyticsHandler }
05-03 16:57:05.670 31675-32420/com.helloheart.app.healthplan.debug D/Localytics: Analytics handler received MESSAGE_UPLOAD_CALLBACK
05-03 16:57:05.671 31675-32420/com.helloheart.app.healthplan.debug V/Localytics: Delete table: events, selection: _id <= 15, selectionArgs: null
05-03 16:57:05.671 31675-32420/com.helloheart.app.healthplan.debug V/Localytics: Deleted 1 rows
05-03 16:57:05.682 31675-32420/com.helloheart.app.healthplan.debug V/Localytics: android.permission.WAKE_LOCK is missing from the Manifest file.
05-03 16:57:05.763 4365-4365/? V/GLSActivity: AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
05-03 16:57:05.843 3329-3361/? W/System: ClassLoader referenced unknown path: /system/framework/com.qualcomm.qti.GBAHttpAuthentication.jar
05-03 16:57:06.116 31675-32429/com.helloheart.app.healthplan.debug A/art: art/runtime/fault_handler.cc:117] Check failed: !initialized_ 
05-03 16:57:06.198 2648-3587/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=332, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@c1d350f)
05-03 16:57:06.198 2648-4478/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=333, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@d895a6e)
05-03 16:57:06.198 2648-3421/? I/WindowState: WIN DEATH: Window{3445316 u0 com.helloheart.app.healthplan.debug/com.helloheart.app.DashboardActivity}
05-03 16:57:06.199 2648-3377/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=333, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
05-03 16:57:06.205 259-635/? I/SFPerfTracer:      triggers: (rate: 0:85) (10887 sw vsyncs) (0 skipped) (114:439114 vsyncs) (116:497930)
05-03 16:57:06.205 2648-2661/? D/GraphicsStats: Buffer count: 7
05-03 16:57:06.219 322-322/? I/Zygote: Process 31675 exited due to signal (11)
05-03 16:57:06.222 2648-3377/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=333, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
05-03 16:57:06.222 2648-3377/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=332, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
05-03 16:57:06.223 2648-2659/? I/ActivityManager: Process com.helloheart.app.healthplan.debug (pid 31675) has died
05-03 16:57:06.224 2648-2659/? W/ActivityManager: Force removing ActivityRecord{1f6f89a u0 com.helloheart.app.healthplan.debug/com.helloheart.app.DashboardActivity t138}: app died, no saved state
05-03 16:57:06.225 2648-2659/? I/ActivityManager: moveHomeStack, setupComplete:true

这里唯一让我感到可疑的是这一行代码:
05-03 16:57:06.116 31675-32429/com.helloheart.app.healthplan.debug A/art: art/runtime/fault_handler.cc:117] Check failed: !initialized_

我正在使用Realm(非常老的版本- 0.81.1)进行本地存储。当某种类型的数据有超过200条记录时,应用程序几乎肯定会崩溃。

我已经无法确定问题所在。您有什么想法?我在哪里可以找到跟踪信息?


GoogleHttpClient: GMS http client unavailable, use old client - zgc7009
它似乎不是来自我们的进程。我正在使用OkHttp。 - stavv
你是出于什么兴趣选择了OkHttp而不是Volley呢? - zgc7009
@zgc7009,就是因为我开始使用由Square公司维护的Retrofit,所以我没有时间去调查选择哪个框架,但我对它非常满意。到目前为止,没有什么让我后悔的。 - stavv
你能详细说明一下代码中的删除事件吗? - Prajwal Waingankar
请问您能否分享一下您的调查结果? - user1506104
2个回答

0

你的清单文件中还缺少一个权限,这是由堆栈跟踪指示的。

com.helloheart.app.healthplan.debug V/Localytics: android.permission.WAKE_LOCK is missing from the Manifest file.

此外,在Android Studio中,您可以将调试消息过滤到您的apk中。在Android 6中,您可能还需要在运行时请求权限。
从Android 6.0(API级别23)开始,用户在应用程序运行时授予权限,而不是在安装应用程序时授予权限。这种方法简化了应用程序安装过程,因为用户不需要在安装或更新应用程序时授予权限。它还使用户对应用程序的功能有更多的控制权;例如,用户可以选择允许相机应用程序访问相机,但不允许访问设备位置。用户可以随时通过转到应用程序的设置屏幕来撤销权限。 来源

不知道他们是否更新了 M 的权限并忘记包含这个,但这并不改变它确实缺失的事实 :) - zgc7009
我们没有更新应用程序以支持Android M权限软件。自从我们集成了Localytics以来,我在日志中看到了这条消息。这并没有影响应用程序,只会影响我们的分析数据发送方式,而这并不是我们目前的主要任务。 - stavv

0
尝试在您的权限代码中添加这行代码。 问题似乎是由于权限引起的:
public void onRequestPermissionsResult(Context context, int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
   if (permissions == null || permissions.length == 0 || grantResults == null || grantResults.length == 0) {
       return;
   }
}

抱歉,因为我一直在用手机添加这个答案,所以进行了编辑!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接