Reputation: 1877
I am currently working on an Android application in which one I use 2 native libraries:
On some Android device, on a specific use case, the GStreamer native library crashes my app with the following stacktrace:
Fatal signal 11 (SIGSEV), code 1 (SEGV_MAPPER), fault addr 0xaaaaaaaaaaaaaaa in tid 2458 (souphttpsrc0:sr), pid 2334 (application.id)
#05 pc 00000000000e24a4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: ceedf0f98da575de138b0c631aceca44)
#06 pc 0000000000083d98 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ceedf0f98da575de138b0c631aceca44)
I can see this issue into the logcat but not into my Firebase Crashlytics console. In order to be aware of the NDK crashs into my app, I would like to implement the Firebase Crashlytics for NDK SDK.
My application contains 2 flavor dimensions:
If I add the 2 built types (debug and release), it means that I have 12 build variants.
For the 2 "app" dimensions, I use a different version of the GStreamer library. GStreamer is not built directly into my Android application with a dedicated NDK script that builds so files.
baresip is built into my application using cmake:
externalNativeBuild
{
cmake
{
cFlags '-DHAVE_INTTYPES_H'
}
}
Here the structure of my project:
project/
+- app/
|
+- src/
|
+- main/
|
+- ccp/
|
+- baresipenative.c
+- CMakeLists.txt
+- appFlavor1/
|
+ jniLibs/
|
+- arm64-v8a/
|
+- libc++_shared.so
+- libgstreamer_android.so
+- libgstreamernative.so
+- armeabi-v7a/
|
+- libc++_shared.so
+- libgstreamer_android.so
+- libgstreamernative.so
+- appFlavor2/
|
+ jniLibs/
|
+- arm64-v8a/
|
+- libc++_shared.so
+- libgstreamer_android.so
+- libgstreamernative.so
+- armeabi-v7a/
|
+- libc++_shared.so
+- libgstreamer_android.so
+- libgstreamernative.so
According to the Firebase Crashlytics NDK SDK, I need to configure the firebaseCrashlytics
properties into the build.gradle
file.
When I configure only the nativeSymbolUploadEnabled
, nothing appears into the Crashlytics console:
firebaseCrashlytics {
nativeSymbolUploadEnabled true
}
So I guess that I need to configure also the strippedNativeLibsDir
and the unstrippedNativeLibsDir
properties like this:
firebaseCrashlytics {
nativeSymbolUploadEnabled true
strippedNativeLibsDir 'path/to/stripped/parent/dir'
unstrippedNativeLibsDir 'path/to/unstripped/parent/dir'
}
If I understand correcly the documentation, into thestrippedNativeLibsDir
property, I should put the path to the obj
directory of baresip build files ?
And into the unstrippedNativeLibsDir
property I should put the path to so files of GStreamer ?
Thank you in advance for your help!
Upvotes: 1
Views: 1116
Reputation: 742
Finding the correct paths for the stripped and unstripped libs is an entire problem on it's own. As per your questions, I'm not sure we can deduce exactly what directories to use from the project struct you've given!
Usually, a path similar to ../build/intermediates/cmake
is used for the unstripped libs, while ../build/intermediates/stripped_native_libs
is used for the stripped libs field.
If you're using CMake to build your native libs, why not trying to follow this quick tutorial which will hopefully steer you in the right direction; you can always skip reading towards the end where the problematic lib directories are explained.
Upvotes: 1