Append the following lines to android/settings.gradle:
include ':expo-firebase-auth'
project(':expo-firebase-auth').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-auth/android')
and if not already included
include ':expo-core'
project(':expo-core').projectDir = new File(rootProject.projectDir, '../node_modules/expo-core/android')
include ':expo-firebase-app'
project(':expo-firebase-app').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-app/android')
Insert the following lines inside the dependencies block in android/app/build.gradle:
api project(':expo-firebase-auth')
and if not already included
api project(':expo-core')
api project(':expo-firebase-app')
Some Unimodules are not included in the default ExpoKit suite, these modules will needed to be added manually. If your Android build cannot find the Native Modules, you can add them like this: ./android/app/src/main/java/host/exp/exponent/MainActivity.java
/*
* At the top of the file.
* This is automatically imported with Android Studio, but if you are in any other editor you will need to manually import the module.
*/
import expo.modules.firebase.app.FirebaseAppPackage; // This should be here for all Expo Firebase features.
import expo.modules.firebase.auth.FirebaseAuthPackage;
// Later in the file...
@Override
public List<Package> expoPackages() {
// Here you can add your own packages.
return Arrays.<Package>asList(
new FirebaseAppPackage(), // This should be here for all Expo Firebase features.
new FirebaseAuthPackage() // Include this.
);
}
Could you take a look please? Especially the MainActivity.java. I don’t really know what weng wrong. It’s a fresh new expo init project just with firebase import.
My package.json is clean, and iOS runs fine, so it must be something on the Android side.
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalArgumentException: Given String is empty or null