Specified path for unstripped native libs is not a directory - generateCrashlyticsSymbolFileRelease
Asked Answered
J

2

9

How I can define androidNdkOut and androidNdkLibsOut paths with new Firebase Crashlytics SDK?

When I try to run: ./gradlew clean assembleRelease uploadCrashlyticsSymbolFileRelease

I get next error:

Execution failed for task ':app:generateCrashlyticsSymbolFileRelease'.
> java.io.IOException: Specified path for unstripped native libs is not a directory: /Users/martin/repos/example-app-android/app/obj

If I manually move all my NDK libs to ./app folder I get the same error with different path:

Execution failed for task ':app:generateCrashlyticsSymbolFileRelease'.
> java.io.IOException: Specified path for stripped native libs is not a directory: /Users/martin/repos/example-app-android/app/build/intermediates/transforms/stripDebugSymbol/release

In this second case the build command sometimes fails, sometimes not.

This issue started to appear after I moved from Fabric Crashlytics plugin to Firebase Crashlytics plugin. In the Fabric case, I had the option to define: androidNdkOut and androidNdkLibsOut paths. Is that missing in the new Firebase plugin?

Relevant Code:

Old code example:

    crashlytics {
        enableNdk true
        androidNdkOut "$buildDir/ndklibs/obj"
        androidNdkLibsOut "$buildDir/ndklibs/libs"
    }

New Code example:

            firebaseCrashlytics {
                nativeSymbolUploadEnabled true

            }
Jessiajessica answered 5/2, 2020 at 9:10 Comment(2)
Hi, could you restructure the question title, for ease of understanding, and do make it specific.Proofread
Updated, I hope it is more clear now :)Jessiajessica
J
8

I got answer on this link in a meantime: https://github.com/firebase/firebase-android-sdk/issues/1199#issuecomment-584680918

In the new Firebase Crashlytics plugin, the androidNdkOut and androidNdkLibsOut properties have been changed to strippedNativeLibsDir and unstrippedNativeLibsDir, and should be declared in firebaseCrashlytics within the variant block, where you declared nativeSymbolUploadEnabled true.

There is still the issue with the paths itself, you need to set relative paths for the strippedNativeLibsDir and unstrippedNativeLibsDir to your /app directory. Example: https://github.com/firebase/firebase-android-sdk/issues/1199#issuecomment-585262965

Jessiajessica answered 18/2, 2020 at 10:23 Comment(0)
D
0

Provided by topic starter New Code example is not working in my case, crashing during build with exception: "Crashlytics could not determine unstripped native library directories for project"

Working code is:

firebaseCrashlytics {
    nativeSymbolUploadEnabled true
    strippedNativeLibsDir "build/ndklibs/obj"
    unstrippedNativeLibsDir "build/ndklibs/libs"
}
Dior answered 17/8, 2021 at 2:39 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.