0

I have configured build.gradle and Application to make Crashlytics works. But not able to figure out why the c++ code is showing "missing" and no any detail information(line number, call stack). "./gradlew crashlyticsUploadSymbolsdevelopmentRelease" succeed without any error. The stack trace of java code crash report works. Only crash report of c++ code show "missing".

enter image description here The "libengine" is used by Java code through JNI.

build by:
externalNativeBuild {
   cmake {
      path "CMakeLists.txt"
   }
}


my build.gradle:
crashlytics {
    enableNdk true
    androidNdkOut 'build/intermediates/cmake/development/debug/obj'
    androidNdkLibsOut 'build/intermediates/cmake/development/release/obj'
    manifestPath 'src/main/AndroidManifest.xml'
}
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
roc
  • 41
  • 7
  • Do you have access to the unstripped, debug version of these libraries? – Mike Bonnell Oct 02 '18 at 13:57
  • @MikeBonnell Yes, i have. The debug version is in "build/intermediates/cmake/development/debug/obj" directory. I had also run ./gradlew crashlyticsUploadSymbolsdevelopmentDebug to upload that. – roc Oct 02 '18 at 14:04
  • Ok and which versions of our SDK and gradle plugin are you using? – Mike Bonnell Oct 02 '18 at 17:33
  • @MikeBonnell dependencies { implementation('com.crashlytics.sdk.android:crashlytics:2.9.5') { transitive = true } implementation('com.crashlytics.sdk.android:crashlytics-ndk:2.0.5') { transitive = true } } – roc Oct 02 '18 at 18:00
  • @MikeBonnell I didn't figure out how to list the plugin version of io.fabric ? Where i can get it ? I use the the fabric Android studio plugin to automatically add all such configuration, it should be the default or latest.* – roc Oct 02 '18 at 18:06
  • Hey Roc - look for this line or somthing similar classpath 'io.fabric.tools:gradle:1.+' – Mike Bonnell Oct 02 '18 at 19:04
  • Hi, i have a exact same line in my build.gradle "classpath 'io.fabric.tools:gradle:1.+'" – roc Oct 02 '18 at 20:22
  • @MikeBonnell Hi, i have a exact same line in my build.gradle "classpath 'io.fabric.tools:gradle:1.+'" – roc Oct 03 '18 at 12:58
  • Gotcha, in your build.log of Crashlytics do you see the library symbols being uploaded? – Mike Bonnell Oct 03 '18 at 19:14
  • @MikeBonnell where i can find that build.log ? In webpage of fabric.io or my android app project directory ? – roc Oct 03 '18 at 19:55
  • Ahh, sorry. On Linux / Windows:~/.crashlytics/com.crashlytics.tools/crashlytics.logOn Mac:~/Library/Caches/com.crashlytics/com.crashlytics.tools/crashlytics.log – Mike Bonnell Oct 03 '18 at 20:45
  • @MikeBonnell i saw "com.crashlytics - cSYM file(s) uploaded." in the log file. – roc Oct 03 '18 at 21:02
  • @MikeBonnell The issue is even worse now, the (c++ code) crash is not shown in Crashlytics. – roc Oct 03 '18 at 21:39
  • @MikeBonnell I make a test code which using null pointer in 1 minute after app startup in Samsung tablet, The app crashed but no any crash report is shown in Crashlytics. Where i can check the crash file do generated in Samsung android tablet and it was uploaded to Crashlytics? It is very strange, i still can get java crash report. Now i believe the symbol are uploaded successfully, but i dont get crash report any more. – roc Oct 04 '18 at 07:56
  • @MikeBonnell Is the c++ crash report taken longer time to be processed and shown in Crashlytics ? How long ? – roc Oct 04 '18 at 13:14
  • Hey Roc - I believe you were affected by this production issue on our end: http://status.fabric.io/incidents/0hf9twr1rb74 Crashes should be flowing in now. – Mike Bonnell Oct 04 '18 at 15:52
  • 1
    @MikeBonnell Thank you so much. Now it works, i can see the c++ file line number and call stack. – roc Oct 04 '18 at 20:37
  • correct one configuration for later readers, should be : crashlytics { enableNdk true androidNdkOut 'build/intermediates/cmake/development/release/obj' androidNdkLibsOut 'build/intermediates/transforms/stripDebugSymbol/development/release/0/lib' } – roc Oct 04 '18 at 20:38

1 Answers1

1

The issue is the wrong path for the obj and lib in build.gradle. In my case, the c++ library is built by cmake, i should configure as below for uploading symbol for release build.

    crashlytics {
        enableNdk true
        androidNdkOut 'build/intermediates/cmake/development/release/obj'
        androidNdkLibsOut 'build/intermediates/transforms/stripDebugSymbol/development/release/0/lib'
        manifestPath 'src/main/AndroidManifest.xml'
    }

    #in order to avoid manually run crashlyticsUploadsSymbols
    android.applicationVariants.all { variant ->
        def variantName = variant.name.capitalize()
        if(variant.buildType.name=="release")
        variant.assemble.finalizedBy(project.("crashlyticsUploadSymbols${variantName}"))
    }

I learned to check if uploading succeed by checking:

~/Library/Caches/com.crashlytics/com.crashlytics.tools/crashlytics.log
DaveAlden
  • 30,083
  • 11
  • 93
  • 155
roc
  • 41
  • 7