Artin Falahi
Artin Falahi

Reputation: 1151

Mismatch between react-native gradle config and react-native-firebase last version

I have a react-native project in which I want to use firebase notification. I found react-native-firebase as a most popular library to do that. The problem is after installing the last version of react-native-firebase, the project cannot be build because of the mismatch between my project gradle version (It's a guess) and react-native-firebase. Also I cannot add other configurations to build.gradle file.

Error:
    * Where:
    Build file '/home/hassan/Documents/project/ems/reactApp/node_modules/react-native-firebase/android/build.gradle' line: 3

    * What went wrong:
    A problem occurred evaluating project ':react-native-firebase'.
    > Could not find method google() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

As I'm not so expert with android studio and gradle, I cannot come up with an idea to figure it out. To put in the nutshell my questions are:

Upvotes: 0

Views: 655

Answers (1)

coder2017
coder2017

Reputation: 331

Update distributionUrl in gradle-wrapper.properties (android/gradle/wrapper/gradle-wrapper.properties)

 distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Also, make sure to follow the installation steps in the following link https://rnfirebase.io/docs/v4.3.x/installation/android

Upvotes: 2

Related Questions