简体   繁体   中英

Android Crashlytics ndk; values of NdkOut and NdkLibsOut in build.gradle

I have integrated Crashlytics, Fabric into my app, the sdk related crashes are reported successfully.

For the ndk part, i have followed instructions from the blog; The Wait is Over: Launching Crashlytics for Android NDK , but the ndk crashes aren't being reported. My doubt is, because other parts are sufficiently clear, i'm not providing the correct path for androidNdkOut and androidNdkLibsOut , as shown in:

在此输入图像描述

The doubt and question is in my build.gradle , here it is...

crashlytics {  

    enableNdk true
    androidNdkOut //what would be the obj here?
    androidNdkLibsOut 'src/main/jniLibs' //path for my jni libraries  

}

please let me know if i should post any other part of the code

EDIT/UPDATE July 7, 2017

Matt from the Fabric team here with an update to this answer - we just released the Fabric Gradle plugin version 1.23.0 which includes support for automatically detecting the appropriate native library paths when you're using the externalNativeBuild DSL with the Android plugin for Gradle version 2.2.0+, so you no longer need to set the androidNdkOut and androidNdkLibsOut properties. This will work with both CMake and ndk-build . Check out more info here: https://docs.fabric.io/android/crashlytics/ndk.html#specifying-the-path-to-debug-and-release-binaries


I could solve the problem after getting help from Crashlytics/Fabric Support, thanking them..this answer.

First, for

crashlytics {  

    enableNdk true
    androidNdkOut //what would be the obj here?
    androidNdkLibsOut 'src/main/jniLibs' //path for my jni libraries  

}  

for my app's build.gradle , it should have been:

crashlytics {
    enableNdk true
    androidNdkOut 'src/main/jniLibs'
    androidNdkLibsOut 'src/main/jniLibs'
}  

androidNdkOut is where your debug binaries are located. This defaults to 'src/main/obj' but you can set in the crashlytics { } if it's different in your project.

a link which contains useful information on the same: crashlytics knowledgebase; Missing line numbers in native crashes

A minor but very useful part was running commands like uploadReleaseSymbols with the --stacktrace option. Thought its worth the mention as that(uploading release symbols) was also an issue on my side for not receiving the crash reports.

Follow this guide - https://fabric.io/downloads/gradle/ndk . We kept empty both fields (androidNdkOut and NdkLibsOut)

Had a similar problem: I had to add CrashlyticsNdk kit at Fabric.with().

Fabric fabric = new Fabric.Builder(context)
    .kits(new Twitter(authConfig), new Crashlytics(), new CrashlyticsNdk())
    .debuggable(true)
    .build();
Fabric.with(fabric);

you can check androidNdkOut , androidNdkLibsOut this way.

$ ./gradlew -d clean assemble{Flavor} | grep ndk-build

and you will find NDK_OUT and NDK_LIBS_OUT .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM