mobibob
mobibob

Reputation: 8794

GradleException: Crashlytics could not determine stripped/unstripped native library directories

There is plenty of "chatter", but I did not find an answer for my project.

While performing the Gradle Sync in my project with Crashlytics, Gradle fails to sync. I have other projects that are just fine and when I 'diff' the build.gradle files and other Android Studio settings, they have the same values and settings related to Crashlytics.

A problem occurred configuring project ':app'.
> org.gradle.api.GradleException: Crashlytics could not determine stripped/unstripped native library directories for project ':app', variant Debug. These are required for generating symbol files when NDK build tasks cannot be automatically inferred. Please specify strippedNativeLibsDir and unstrippedNativeLibsDir in the firebaseCrashlytics extension.

I am not looking for someone to triage my configuration, instead I want to know where in my project files can I find the "firebaseCrashlytics extension" and its configuration and where are the stripped and unstripped files so I can supply a path? If you know the answer from documentation, please share the link.

Upvotes: 12

Views: 8476

Answers (3)

Bataleon
Bataleon

Reputation: 3349

Make sure your android/app/build.gradle has the following:

release {
     // ...
     firebaseCrashlytics {
          nativeSymbolUploadEnabled true
          strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
          unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
     }
     // ...
 }

See https://github.com/invertase/react-native-firebase/issues/4253#issuecomment-797187492

Upvotes: 19

Yavor Mitev
Yavor Mitev

Reputation: 1523

In my case, I had a few projects cloned locally of the same repo. One of them was for a too old branch. Like 3-4 years back. For it, I have given a path to another NDK in the local.properties file.

ndk.dir=C\:\\NDK\\android-ndk-r13b\\android-ndk-r13b

It was causing my problem with the recent branches. After deleting it - it worked. So even if it is not the exact same case for you - it is most likely that you are building with the wrong SDК. Try updating in the SDK manager or maybe actually try explicitly saying what you need as I was doing above.

Upvotes: 3

mobibob
mobibob

Reputation: 8794

In my project-level build.gradle, Android Studio recommends updating the the firebase-crashlytics-gradle from 2.1.1 to 2.4.1. When I take the upgrade recommendation, the gradle sync fails, therefore I am unable to build my project. The error was obscured as I inherited this old project that is several versions behind and I updated all (most) of the frameworks and could not pin-point to this single dependency. I started over and upgraded selectively piecemeal until this was the lone down-level dependency.

I will try again at a later time when there is yet another update to include.

dependencies {
        classpath 'com.android.tools.build:gradle:4.1.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.5'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
        classpath 'org.jacoco:org.jacoco.core:0.8.0'
        // Unable to build with v2.4.1 of firebase-crashlytics-gradle on this version of build (2021/02/02)
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
}

Upvotes: -1

Related Questions