Android app crash without a useful stack trace
Asked Answered
V

2

6

Through out the testing before the release the app worked well. We tested it on a couple of devices and didn't see any problems. Once the app was uploaded to the Play Store one of our users started complaining about the app crashing at one of the tabs. It's not consistent though, the crash rate is about 90%.

Most of the time it crashes at a certain screen but sometimes also right after the user logged in without performing any action.

We use Crashlytics to log our crashes, but we didn't get any reports.

I managed to talk to the user , setup an Android Studio on his computer and have a look at logcat without filters. I coulnd't find any useful error. (I used remote desktop since he is not a technical person)

One of our team members updated his phone to Android 6.0.1 and started having the same issues on his phone too. So I assume it might be related.

I thought it might be ANR but it doesn't freeze and there's nothing in the traces.txt file about our app. I thought it's an OutOfMemoryError (or something similar) but didn't manage to prove it. Asked few of my friends with Android 6.0.1 to test it and all of them, but one with Nexus 6P, experienced the same problem.

That the logcat I get (no filters):

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

The only line here that seems suspicious to me is this:

05-03 16:57:06.116 31675-32429/com.helloheart.app.healthplan.debug A/art: art/runtime/fault_handler.cc:117] Check failed: !initialized_

I'm using Realm (quiet an old version - 0.81.1) for local storage. When there is a certain type of data with more than 200 records the app almost certainly crashes.

I'm running out off idea of how to pin point the problem. Any idea of what I might be missing? Where can I find traces?

Vespucci answered 3/5, 2016 at 14:44 Comment(6)
GoogleHttpClient: GMS http client unavailable, use old clientTemplas
It doesn't seem to come from our process. I'm using OkHttpVespucci
Out of interest, what led you to OkHttp over Volley?Templas
@Templas Simply because I started using Retrofit which is also maintained by Square. I didn't have time to investigate when we had to choose and I'm quiet satisfied with it. Nothing made me regret yetVespucci
Can u specify about the delete event in your code?Schaffer
Would you mind sharing your investigation result please?Cardsharp
M
1

You are also missing a permission in your manifest which is indicated by the stacktrace.

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

Furthermore, you can filter the debug message to your apk only in Android Studio. With Android 6 you may also need to request the permission at run time.

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app's functionality; for example, a user could choose to give a camera app access to the camera but not to the device location. The user can revoke the permissions at any time, by going to the app's Settings screen. Source

Midvictorian answered 3/5, 2016 at 14:48 Comment(2)
Wondering if they updated their permissions for M and forgot to include this, doesn't change the fact it is missing :)Templas
We didn't update the app to support the Android M permissions software. I'm seeing this message in the log since we integrated Localytics. Didn't affect the app, it'll just affect how our analytics are sent and it's not our main priority at the momentVespucci
S
1

Try to add this line of code in your permission code. The problem seems to be because of permissions:

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;
   }
}

Sorry for the edit since I hv been adding this answer from my phone!

Schaffer answered 12/11, 2019 at 16:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.