This project reproduces an issue with Firebase Crashlytics and the Android Gradle Plugin 4.0.x, where native crashes have missing stacktraces.
This project does not contain native code, but has a dependency on the the linphone sdk, which contains native code.
A task extractNdkSymbols is configured to run before uploadCrashlyticsSymbolFile<VariantType>
: it extracts the linphone stripped and unstripped *.so
files to the configured firebaseCrashlytics.strippedNativeLibsDir
and firebaseCrashlytics.unstrippedNativeLibsDir
folders.
Configure the project for your application:
- In
app/build.gradle
, specify the correctapplicationId
- Place your debug and release
google-services.json
files inapp/src/debug
andapp/src/release
, respectively- Make sure the
applicationId
(s) in theapp/build.gradle
file match those in thegoogle-services.json
files.
- Make sure the
- Copy
signing.properties.template
tosigning.properties
and provide the required values for your signing certificate
Build a release app and upload debugging symbols with ./gradlew clean assembleRelease uploadCrashlyticsSymbolFileRelease
- Install the
app/build/outputs/apk/release/app-release.apk
to a device - Launch the CrashObfuscationTest app
- Click on the button "FORCE CRASH"
- Relaunch the app
- Open your project in the Firebase Crashlytics console
- Verify that the crash appears:
- Expected behavior: The crash appears with a deobfuscated stacktrace:
Crashed: Thread: SIGSEGV 0x0000000000000000 at (Missing)() at linphone_core_set_adaptive_rate_algorithm + 2020(linphonecore.c:2020) at Java_org_linphone_core_CoreImpl_setAdaptiveRateAlgorithm + 15215(linphone_jni.cc:15215)
- Actual behavior: The crash appears with an empty stacktrace:
Crashed: Thread #1 SIGSEGV 0x0000000000000000 0 libc.so (Missing) 1 liblinphone.so (Missing) 2 base.odex (Missing) 3 (Missing)
- Expected behavior: The crash appears with a deobfuscated stacktrace:
In the root build.gradle
, specify 3.6.3
for the android gradle plugin and repeat the Building and Testing steps. The expected deobfuscated stacktrace appears.