react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

Attempted to use firebase module that's not installed on your android project- firebase.storage()

Open thepatrykk opened this issue 8 years ago • 32 comments

I have an error why I try call **firebase.storage()** anywhere in the app. What is more firebase.auth(), firebase.database() working fine.

I did gradlew clean, reinstalled all from package.json. Nothing help.

This bellow should be fine because auth and database work fine, but I paste it.

My build.gradle file

dependencies {
    compile project(':react-native-image-crop-picker')
    compile(project(':react-native-firebase')) {
        transitive = false
    }
    compile project(':react-native-fetch-blob')
    compile project(':react-native-fbsdk')
    implementation project(':react-native-image-crop-picker')
    implementation project(':react-native-fbsdk')
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation project(':react-native-firebase')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:27.1.1"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation(project(':react-native-firebase')) {
        transitive = false
    }

    implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
        transitive = true
    }

    implementation "com.google.android.gms:play-services-base:12.0.1"
    implementation "com.google.firebase:firebase-core:12.0.1"
    implementation "com.google.firebase:firebase-auth:12.0.1"
    implementation "com.google.firebase:firebase-database:12.0.1"

}

Environment

ANDROID

  1. Application Target Platform: MacOS android studio emulator

  2. Development Operating System: Nexus 6 API 27

  3. Build Tools:

  1. React Native version: "react-native": "0.54.1",

  2. RNFirebase Version: "react-native-firebase": "4.0.0",

thepatrykk avatar Apr 13 '18 17:04 thepatrykk

Please follow the installation instructions: https://rnfirebase.io/docs/v4.0.x/storage/android

You need to include the firebase-storage dependency in your build.gradle.

chrisbianca avatar Apr 13 '18 17:04 chrisbianca

I am having similar issue with messaging, I am not using pods with linked the framework manually

noumantahir avatar Sep 19 '18 08:09 noumantahir

@chrisbianca I don't know why people are down voting you. I was stuck by hours trying to get out of this error and the solution was install the firebase analytics part.

Thank you man!

phsantiago avatar Nov 29 '18 22:11 phsantiago

I need you guys to help me solve this error please. I got stuck with this error in couple of week. can you guys help me please. my error is Error: you attempted to use a firebase module that's not installed on your android project by calling firebase.auth(). Is the above error same with this error? Thank you. Screenshot_1553074894

meyonn avatar Mar 20 '19 09:03 meyonn

I need you guys to help me solve this error please. I got stuck with this error in couple of week. can you guys help me please. my error is Error: you attempted to use a firebase module that's not installed on your android project by calling firebase.auth(). Is the above error same with this error? Thank you.

stuck her too i triple check the installation doc

alainib avatar Mar 26 '19 13:03 alainib

I saw this once when I did not follow the installation doc. In your android application java did you actually include/initialize things?

https://github.com/invertase/react-native-firebase-docs/blob/v5.x.x/docs/auth/android.md#install-the-rnfirebase-authentication-package

mikehardy avatar Mar 26 '19 13:03 mikehardy

I solved the issue using:

new RNFirebaseNotificationsPackage()

into my MainApplication.java

fgagneten avatar Apr 06 '19 17:04 fgagneten

app/build.gradle implementation "com.google.firebase:firebase-storage:15.0.2"

MainApplication.java

import io.invertase.firebase.RNFirebasePackage; import io.invertase.firebase.auth.RNFirebaseAuthPackage; // <-- Add this line

public class MainApplication extends Application implements ReactApplication { // ...

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new RNFirebasePackage(),
      new RNFirebaseAuthPackage() // <-- Add this line
  );
}

}; // ... }

Anuskhan avatar Jul 05 '19 06:07 Anuskhan

Screenshot_1563990196

Capture 2 Capture 1

I am stuck on this error and unable to solve it for 2 weeks, Please help me. I even installed react-native-firebase-auth

Jahanzai6 avatar Jul 24 '19 17:07 Jahanzai6

Im facing the same issue as @Jahanzai6 . Tried everything given on this thread. Included the dependencies in build.gradle as well as the main.application.java. But still showing the same error. Can someone please help here

BilalS10 avatar Jul 25 '19 12:07 BilalS10

haven't find the solution yet

Jahanzai6 avatar Aug 06 '19 13:08 Jahanzai6

i have same issue

optimistic-coder avatar Aug 11 '19 18:08 optimistic-coder

i have same issue

I have found the solution, if u r using react native version 0.60 then u have to add package in the MainApplication.java in following way. packages.add( new RNFirebaseAuthPackage());

After adding this package if ur app is still not working then uninstall ur app from emulator and reinstall .....Then everything will work

Jahanzai6 avatar Aug 12 '19 04:08 Jahanzai6

Im facing the same issue as @Jahanzai6 . Tried everything given on this thread. Included the dependencies in build.gradle as well as the main.application.java. But still showing the same error. Can someone please help here

I Found the solution, read my above comment.

Jahanzai6 avatar Aug 12 '19 04:08 Jahanzai6

i have same issue

I have found the solution, if u r using react native version 0.60 then u have to add package in the MainApplication.java in following way. packages.add( new RNFirebaseAuthPackage());

After adding this package if ur app is still not working then uninstall ur app from emulator and reinstall .....Then everything will work

thanks it's very helpful for me @Jahanzai6

optimistic-coder avatar Aug 12 '19 08:08 optimistic-coder

For react-native-firebase modules on RN59 follow the pattern here https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-rn59.sh

You can see what you have to do for each one in that script. You also have to add the pod in the Podfile for iOS of course

mikehardy avatar Aug 12 '19 13:08 mikehardy

i have same issue

I have found the solution, if u r using react native version 0.60 then u have to add package in the MainApplication.java in following way. packages.add( new RNFirebaseAuthPackage());

After adding this package if ur app is still not working then uninstall ur app from emulator and reinstall .....Then everything will work

this is the right solution for whoever is using react-native 0.60+

bimix avatar Aug 16 '19 18:08 bimix

i have same issue

I have found the solution, if u r using react native version 0.60 then u have to add package in the MainApplication.java in following way. packages.add( new RNFirebaseAuthPackage());

After adding this package if ur app is still not working then uninstall ur app from emulator and reinstall .....Then everything will work

After adding the above code, I got error as

 packages.add( new RNFirebaseAuthPackage()),

            ^
  symbol:   variable packages
  location: class MainApplication

creativemind1 avatar Apr 10 '20 09:04 creativemind1

@creativemind1 - an infinite number of ways to go wrong, maybe try generating a throwaway example by cloning this repo and running this script (assuming you are trying react-native-firebase v5 + react-native 0.60+?): https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

mikehardy avatar Apr 10 '20 16:04 mikehardy

I'm using "react-native-firebase": "~5.6.0", "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",. I'm using Expokit and in iOS all is fine but just have trouble with android. I wanted to clone your repo but again I thought as I'm using Expokit there might be some glitch somewhere..

creativemind1 avatar Apr 10 '20 17:04 creativemind1