New rn version crash with react-native-firebase on Android
Versions
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-firebase": "^5.5.5",
MainApplication.java with new getPackages()
function
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new RNFirebasePackage());
packages.add(new RNFirebaseDatabasePackage());
packages.add(new RNFirebaseAuthPackage());
return packages;
}
Error:
Overlap with 0.60 autolink. Remove from MainApplication.java like it says. But eventually you will likely hit the redbox I'm getting: https://github.com/invertase/react-native-firebase/issues/2411
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new RNFirebasePackage()); //=> remove this line and also from header import
packages.add(new RNFirebaseDatabasePackage());
packages.add(new RNFirebaseAuthPackage());
return packages;
}
This is unrelated to react-native-firebase, I have a demo that shows how to successfully build and run RN60 - you can see how it does what it does, or just use it for boilerplate https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh
Can the documentation be updated to reflect this? It still shows the old way where the package is included and the old way of including module packages as well.
@TrekSoft it certainly can be! There's an edit button at the top of each documentation page, please make a PR 馃檹
Ok awesome - let me verify my code works and I'll do that.
Here it is for auth and if this looks good, will submit another one for all the other modules: https://github.com/invertase/react-native-firebase-docs/pull/208
protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); packages.add(new RNFirebasePackage()); //=> remove this line and also from header import packages.add(new RNFirebaseDatabasePackage()); packages.add(new RNFirebaseAuthPackage()); return packages; }
thanks god for born you
Thank-you!
Most helpful comment