GradleException:Crashlytics 无法确定剥离/未剥离的本机库目录

mob*_*bob 10 crashlytics android-studio

有很多“闲聊”,但我没有找到我的项目的答案。

在我的项目中使用 Crashlytics 执行 Gradle 同步时,Gradle 无法同步。我还有其他项目,这些项目都很好,当我“比较”build.gradle 文件和其他 Android Studio 设置时,它们具有与 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.
Run Code Online (Sandbox Code Playgroud)

我不是在寻找某人来分类我的配置,而是想知道在我的项目文件中的哪里可以找到“firebaseCrashlytics 扩展”及其配置,以及剥离和未剥离的文件在哪里,以便我可以提供路径?如果您从文档中知道答案,请分享链接。

Bat*_*eon 19

确保您android/app/build.gradle具备以下条件:

release {
     // ...
     firebaseCrashlytics {
          nativeSymbolUploadEnabled true
          strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
          unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
     }
     // ...
 }
Run Code Online (Sandbox Code Playgroud)

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


mob*_*bob -1

在我的项目级 build.gradle 中,Android Studio 建议将firebase-crashlytics-gradle2.1.1 更新到 2.4.1。当我接受升级建议时,gradle sync失败,因此我无法构建我的项目。该错误被掩盖了,因为我继承了这个落后几个版本的旧项目,并且我更新了所有(大多数)框架,并且无法精确指向这个单一依赖项。我重新开始并有选择地进行升级,直到这是唯一的下层依赖项。

当有另一个更新要包含时,我会在稍后重试。

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'
}
Run Code Online (Sandbox Code Playgroud)