10

We have recently updated our apps to use Android App Bundles (aab) and to also include arm64 native libs.

Since doing so, our crash logs in native code in the 'Google Play Console'->'Android Vitals'->'ANRs & Crashes' are not symbolicating correctly (java callstacks symbolicate fine).

A snippet from a typical callstack looks like this:

  #21  pc 000000000015addc  /data/app/com.mycompany.mygame-2/split_config.arm64_v8a.apk
  #22  pc 0000000000293768  /data/app/com.mycompany.mygame-2/split_config.arm64_v8a.apk
  #23  pc 0000000000294cf0  /data/app/com.mycompany.mygame-2/split_config.arm64_v8a.apk

The issue affects crashes from both armv7 and arm64. Occasionally a bug will have a properly symbolicated callstack, approximately 10% are symbolicated properly now. Prior to the use of AAB and arm64, we were seeing almost all callstacks symbolicated correctly.

To work around this, we investigated using Crashlytics, but had trouble getting a properly symbolicated callstack that way also. As we haven't used Crashlytics before it is difficult for us to know whether it suffers from the same issue or whether we simply setup Crashlytics incorrectly. However, this post indicates that other users may be having trouble with AABs and Crashlytics.

Is anyone else experiencing similar difficulties?

Are there any known workarounds?

Has anyone updated to use AABs and is not seeing any problem with crash report symbolication in the Google Play console?

Columbo
  • 6,648
  • 4
  • 19
  • 30
  • I believe you can take the stack as above and feed the addresses to **addr2line** utility in your NDK toolchain. You will need to provide the unstripped so file that corresponds to the version embedded in PlayStore aab. – Alex Cohn May 03 '19 at 19:58
  • Does this answer your question? [Crashlytics Missing NDK symbols with android app bundle](https://stackoverflow.com/questions/55423548/crashlytics-missing-ndk-symbols-with-android-app-bundle) – TomTasche May 03 '20 at 13:46

1 Answers1

18

Edit: The NDK 21 RC1 should fix this issue.

This seems related to the fact that native libraries are kept uncompressed in the APK.

By adding the following option in your gradle.properties, you can disable it:

android.bundle.enableUncompressedNativeLibs=false

You'll need to release a new App Bundle built with this option.

Pierre
  • 15,865
  • 4
  • 36
  • 50
  • Sounds promising, thanks. Might be a week or so until I can turn around an update to find out whether it helps, but I'll report back when I do. – Columbo May 03 '19 at 19:43
  • 1
    Keep in mind that disabling this feature will make your app bigger on users' devices since the platform then has to extract the native libraries to be able to load them. – Pierre May 03 '19 at 23:18
  • Yes, that seems to have fixed it. Thank you! (little bounty on its way) – Columbo May 08 '19 at 15:46
  • I had the exact same problem and this fixed it for me, thank!. @Pierre do you know if there's anyway to fix this problem without this flag? – Loolooii Jun 05 '19 at 16:51
  • 2
    A team at Google is looking at addressing this issue. Note that in the latest canary of Gradle, this flag won't be marked as unsupported. – Pierre Jun 05 '19 at 19:43
  • Is this still being an issue? Because I'm receiving some identical crashes in the Play Console but if I add the '''enableUncompressedNativeLibs=false''', then a warning appears saying that the option is experimental and unsupported. I guess it's not a problem anyway to set this configuration. – xarlymg89 Aug 12 '19 at 11:29
  • 1
    The warning has been removed in a later version of the Android Gradle plugin. – Pierre Aug 12 '19 at 21:21
  • The latest NDK should fix this issue. – Pierre Dec 03 '19 at 07:12
  • @pierre do you mean the latest NDK means we no longer need to use `enableUncompressedNativeLibs=false` at all, or that the latest NDK means we'll no longer get the warning about the option being experimental and unsupported? – Columbo Dec 03 '19 at 10:20
  • With the latest NDK you will get full symbolicated stacktraces like before without this gradle property. Re the warning, it shouldn't be there already in the latest Gradle version. – Pierre Dec 03 '19 at 11:50
  • @Pierre Which NDK version would fix this? – shubhamgarg1 Dec 18 '19 at 17:25
  • NDK 21 RC1: https://developer.android.com/ndk/downloads#beta-downloads – Pierre Dec 19 '19 at 10:03