org.gradle.api.GradleException: Crashlytics could not determine stripped/unstripped native library directories for project ':app', variant Release. These are required for generating symbol files when NDK build tasks cannot be automatically inferred. Please specify strippedNativeLibsDir and unstrippedNativeLibsDir in the firebaseCrashlytics extension.
But even if this is added you get a warning saying (and no symbols are uploaded):
Crashlytics could not find NDK build tasks on which to depend. You many need to manually enforce task dependencies for generateCrashlyticsSymbolFileRelease
Steps to reproduce:
See this attached project: TestCrashlyticsGradle.zip
Workaround
In my project I've added this to my app/build.gradle.kts
to fix the issue (Kotlin DSL):
android.buildTypes.all {
// We need to do `== true` because it's `null` by default
if (firebaseCrashlytics.nativeSymbolUploadEnabled == true) {
firebaseCrashlytics {
unstrippedNativeLibsDir = "build/intermediates/merged_native_libs/$name/out/lib/"
strippedNativeLibsDir = "build/intermediates/stripped_native_libs/$name/out/lib/"
// Make the generate symbol task depend on the strip task
tasks.withType<GenerateSymbolFileTask> {
// Ideally we could set the directories here as the input and output of the strip task but
// we get an error unless we set them in the `firebaseCrashlytics` extension
dependsOn("strip${name.removePrefix("generateCrashlyticsSymbolFile")}DebugSymbols")
// Make the upload task depend on the generate task and hook up the inputs correctly
tasks.withType<UploadSymbolFileTask> {
val generateTask = tasks.getByName<GenerateSymbolFileTask>("generateCrashlyticsSymbolFile${name.removePrefix("uploadCrashlyticsSymbolFile")}")
dependsOn(generateTask)
symbolFileDir.set(generateTask.symbolFileOutputDir)
// Lastly make the mappings upload depend on the symbols upload
tasks.withType<UploadMappingFileTask> {
dependsOn("uploadCrashlyticsSymbolFile${name.removePrefix("uploadCrashlyticsMappingFile")}")
I found a few problems with this issue:
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
This issue does not seem to follow the issue template. Make sure you provide all the required information.
com.google.firebase:firebase-crashlytics-ndk:17.3.0
com.google.firebase:firebase-crashlytics-gradle:2.4.1
com.android.tools.build:gradle:4.1.1
gradle 6.7.1
In the crashlytics gradle plugin 2.4.0 release notes, it says:
strippedNativeLibsDir
defined in the firebaseCrashlytics extension is no longer necessary and will be removed in a future release.
However, using 2.4.1, if I remove strippedNativeLibsDir
and run ./gradlew clean assembleRelease uploadCrashlyticsSymbolFileRelease
, I get:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> 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.
> Task with name 'generateCrashlyticsSymbolFileDebug' not found in project ':app'.
If I keep strippedNativeLibsDir
, it works fine.