Douglas Soldan
Douglas Soldan

Reputation: 51

ERROR: Project with path ':@react-native-firebase_app' could not be found in project ':@react-native-firebase_auth'

After install react-native-firebase and add module auth, showed this erro in Android Studio:

ERROR: Project with path ':@react-native-firebase_app' could not be found in project ':@react-native-firebase_auth'.

What does this mean?

Upvotes: 4

Views: 14105

Answers (4)

Sahil bakoru
Sahil bakoru

Reputation: 692

  1. run npm uni @react-native-firebase/auth

  2. then run this simple command @react-native-firebase/[email protected]

I was using "@react-native-firebase/auth": "15.1.1", and having the same problem , then i downgrade it to "@react-native-firebase/auth": "^10.4.1", and it worked.

if you have any problem installing make sure to use --legacy-peer-deps at the end , like this:

npm i @react-native-firebase/[email protected] --legacy-peer-deps

Upvotes: 1

naveen pandi
naveen pandi

Reputation: 645

I have also faced the same issue.

After I install npm i @react-native-firebase/app the problem is solved.

Upvotes: 6

Abhi
Abhi

Reputation: 1177

I think you have different versions of firebase/app and firebase/auth. Just go in 'node module/@react-native-firebase' directory and check package json of both firebase/app and firebase/auth you will see different version.

This problem can also happen if you are using @[email protected] if you check the build.gradle of firebase/auth in version 6.2.0

dependencies {
  api project(':@react-native-firebase_app')
  implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
  implementation "com.google.firebase:firebase-auth"
}

So here is a problem that it is not able to find @firebase/app and @firebase/auth depends on @firebase/app

And in @6.3.4 which is working fine for me have build.gradle of @firebase/auth like below so it is able to find @firebase/app

   if (findProject(':@react-native-firebase_app')) {
    api project(':@react-native-firebase_app')
  } else if (findProject(':react-native-firebase_app')) {
    api project(':react-native-firebase_app')
  } else {
    throw new GradleException('Could not find the react-native-firebase/app package, have you installed it?')
  }
  implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
  implementation "com.google.firebase:firebase-auth"
}

Upvotes: 1

RowanX
RowanX

Reputation: 1317

You can try the following:

-Checking if firebase app was referenced in an incorrect way in MainApplication.java.

-Remove the modules and re-installing them may fix the problem sometimes.

Upvotes: 1

Related Questions