Metehan Toksoy
Metehan Toksoy

Reputation: 1935

Crashlytics with Hello Jni App

I got some issues with crashlytics. I think I cannot set crashlytics androidNdkOut and androidNdkLibsOut paths.

First question is what is gradle's default output path for ndk according to the this gradle settings ? Second if settings are correct why I saw my ndk errors as "???" on Crashlytics dashboard?

Here is my app build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'io.fabric.tools:gradle:1.21.7'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Here is my module's build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 24
    buildToolsVersion '23.0.3'
    defaultConfig {
        applicationId "com.test.crashlyticsndktest"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ndk {
            moduleName "crashlytics-jni"
            abiFilters "armeabi"
            cFlags "-g"
        }
    }

}

crashlytics {
    enableNdk=true
    androidNdkOut getProjectDir().absolutePath +'/build/intermediates/ndk/debug/lib'
    //androidNdkOut "src/main/obj"
    androidNdkLibsOut getProjectDir().absolutePath + "/build/intermediates/ndk/debug/obj/local"
    //androidNdkLibsOut "src/main/jniLibs"

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.5@aar') { transitive = true; }
}

Here is my proguard file:

-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
-keepattributes SourceFile,LineNumberTable,Annotation
-keep class com.crashlytics.android.**

and here is my Activity's Fabric code:

Fabric.with(this, new Crashlytics(),new CrashlyticsNdk());

Upvotes: 0

Views: 335

Answers (1)

mWillis
mWillis

Reputation: 973

Matt here from the Fabric team!

I wanted to let you know that we've just released version 1.23.0 of the Fabric plugin for Gradle which supports automatically resolving the appropriate native library paths when you're using the Android Gradle plugin 2.2.0+ with the externalNativeBuild DSL, so you no longer have to set androidNdkOut and androidNdkLibsOut if you're using the latest Android Gradle plugin. That should help you get your NDK symbols uploaded correctly and improve your stack traces!

Upvotes: 2

Related Questions