添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Ask Question

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.

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

I tried to upload these libs on play console, but still the crash gives info in binary :/ – Shubhank Tyagi Jun 3, 2021 at 7:52 what if I have flavors? how can I specify which flavor dir to use? release has releaseDev and releaseProd configurations – Wackaloon Jan 14, 2022 at 9:12

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.

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'
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.