React-native-firebase: [馃悰][Android] Could not find method firebaseCrashlytics()

Created on 27 Sep 2020  路  10Comments  路  Source: invertase/react-native-firebase


Issue



Describe your issue here

I was setting up react-native-firebase on a bare react-native app and I followed the optional step here https://rnfirebase.io/crashlytics/android-setup#4-optional-enable-crashlytics-ndk-reporting but I got this error when I do react-native android

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method firebaseCrashlytics() for arguments [build_eb1e26l7v1ub3obnwzg5vs7s$_run_closure1$_closure8$_closure14$_closure15@48eabe2f] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={react_native_dev_server_port=com.android.builder.internal.ClassFieldImpl@99240943, react_native_inspector_proxy_port=com.android.builder.internal.ClassFieldImpl@44d408ec}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.

Project Files






Javascript

Click To Expand

#### `package.json`:

# N/A
#### `firebase.json` for react-native-firebase v6:
# N/A
### iOS
Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

# N/A
#### `AppDelegate.m`:
// N/A


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:

// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->


Environment

Click To Expand

**`react-native info` output:**

 OUTPUT GOES HERE
- **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `e.g. 5.4.3` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N` & `VERSION`




Needs Triage Bug No Template

Most helpful comment

@usama-asfar does not "solve" the issue, "works around incorrect (but optional) NDK crash reporting" is more correct - if you need NDK crash reporting, you need that step, then you may still have this issue if you don't get the config just right.

Precision in troubleshooting is vital, especially if chiming in on other people's issues

All 10 comments

You're missing all the requested information from the templates. Can you try building a reproducible example starting from https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh and posting it?

I am also facing this issue any fix for this @mikehardy @aprilmintacpineda

@FadiAboMsalam no, because the original reporter provided insufficient information.

skipping 4th step solves the issue.

@usama-asfar does not "solve" the issue, "works around incorrect (but optional) NDK crash reporting" is more correct - if you need NDK crash reporting, you need that step, then you may still have this issue if you don't get the config just right.

Precision in troubleshooting is vital, especially if chiming in on other people's issues

That step is optional, this library still works even without that step, you only do it when you want to catch NDK related crashes. I will try to provide a repo for repro, sorry for being unable to do that, my time is all consumed by work-related tasks :(

@aprilmintacpineda I think there is actually another issue in the list that is a little farther along where someone really wants to get the NDK reporting working and is trying to do a build of react-native locally in order to play with the settings for stripped / unstripped directories. That would really advance the state of the art here. That you will get this error just by configuring NDK crash reporting but not providing the directories is a known thing and is correct behavior, simply reproducing it won't move it forward

@mikehardy i am also facing this issuse, used unity 2017.4.31f1, build with il2cpp and mainTemplate, firebase sdk for unity6.16.1;
cannot build success when using :

` implementation 'com.google.firebase:firebase-crashlytics-ndk:17.2.2'`


signingConfigs {
        release {
......
            // Add this extension
              firebaseCrashlytics {
                  nativeSymbolUploadEnabled true
              }
.....
        }
    }

, could you help me ,and the building errorlog :

`

* Where:
Build file '/Users/jens/Documents/AMS/DevBranch/Client/Game/Temp/gradleOut/build.gradle' line: 187

* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> Could not find method firebaseCrashlytics() for arguments [build_4630dycsspsb9cr5ti5hn2v7z$_run_closure7$_closure23$_closure28$_closure29@37d602e6] on SigningConfig_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=null, v1SigningEnabled=true, v2SigningEnabled=true} of type com.android.build.gradle.internal.dsl.SigningConfig.

`

or

* What went wrong:

A problem occurred evaluating root project 'gradleOut'.
> Failed to apply plugin [id 'com.google.firebase.crashlytics']
   > Could not create plugin of type 'CrashlyticsPlugin'.
      > org/gradle/api/tasks/TaskProvider

Waiting for your reply, thanking you;;;

There is no way I will be able to help without a minimal reproduction posted on a github URL
My best advice is to stop using the native symbol upload feature though

Same here. Just went through the tutorial and when trying to add NDK it will fail:

    buildTypes {
        release {
           // .... does not work
            firebaseCrashlytics {
                nativeSymbolUploadEnabled true
            }
        }
    }

Versions:

        classpath('com.android.tools.build:gradle:3.6.3')
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
    "@react-native-firebase/app": "^10.5.0",
    "@react-native-firebase/crashlytics": "^10.5.1",
    "@react-native-firebase/messaging": "^10.5.1",
Was this page helpful?
0 / 5 - 0 ratings