Error while implementing firebase in expo snack (react native) - firebase

image
I encounterd this error while importing firebase to my expo snack which is use for authentication in my app project. Can anyone help me?

The problem is with babel:
Try this first: npm add #babel/runtime
And if that doesn't work try to do this:
as was mentioned above, looks like the presence of this property
watchFolders: [${__dirname}/../..],
in metro.config.js solves the problem. I have a monorepo and mobile app is one of packages, that is why I need ../..
BTW in my case, interopRequireDefault problem appears only when I make a release build with
react-native run-android --variant release
developing mode ( react-native run-android ) works fine even without metro.config.js file
Also, there is no problem if a project is not configured as Monorepo
Reference: https://github.com/facebook/react-native/issues/27712

Related

Emulator is showing error {firebase.App() not found} while using firebase authentication with React Native using expo-cli

While using functionality of authentication through firebase, emulator is showing error i.e.{ you attempted to use a firebase module that is not installed on your android project by calling firebase.app() }.Please help me to resolve this error.
I'm using Expo as command line input.
react-native version -0.63.6,
"#react-native-firebase/app": "^8.4.3",
"#react-native-firebase/auth": "^9.2.3"
If you are using expo client, you should not use react-native-firebase modules because they are not compatible with expo client.
However, you can use firebase javascript SDK instead. It is all explained there.
Update 02-12-2021
Guys expo's eas-build is now public. You can add custom native codes and use react-native-firebase. Here is the link to a youtube tutorial. The video is short and super easy to follow. Here is the link to the docs
Previous answer
Currently, Firebase does not work in react native if you are using the mobile configuration. However, if you use the web configuration it will work. Here is the youtube tutorial. Watch from 38:20 to set up.

React Native FIrebase with Wix React Native Navigation

Has anyone got these 2 working together?
I added react native firebase to my app and it crashes on start up.
I then tested the starter kit provided by react native firebase and once I install react native navigation the app crashes.
Using React Native 0.51, React native navigation v1.1.365 and react native firebase 3.2.2
Thanks
Yeah.
It's Possible.
What I did Was first Installed Firebase and configured.
Then I Installed Wix/react-native Navigation. Follow the steps mentioned in the Official Documentation.
Link for the same to Install and configure is https://wix.github.io/react-native-navigation/#/installation-android.
a command to install library is
"sudo npm install --save react-native-navigation#latest".
Note: App crashes due to MainActivity File. Please remove unwanted code snippet. It should have following code snippet only. As shown Below.
In MainActivity.java it should extend
com.reactnativenavigation.controllers.SplashActivity instead of ReactActivity.
This file can be located in android/app/src/main/java/com/yourproject/.
import com.reactnativenavigation.controllers.SplashActivity;
public class MainActivity extends SplashActivity {
}
Managed to get up and running fully with React Native FCM. Seems to be the best option if using react native navigation.

Can't run Realm with React not native

Created my react app with react-create-app. Installed realm and included it. Get the following error:
Module not found: Can't resolve 'react-native' in
./node_modules/realm/lib/browser/index.js'
It's true that the file requires react-native but my application isn't React Native, it's just React. Installing react-native module anyway does not solve this.
I've tried to use include Realm in a simple javascript file and run it with Node (No React included). It worked. What could cause this to fail in my project? The start script I am using?

Ionic 2 + Firebase issue wrong redirect

I just start developing hybrid apps using Ionic2 and Angular2.
I decide to use Firebase with AngularFire2, following this tutorial:
https://github.com/angular/angularfire2/blob/master/docs/1-install-and-setup.md
Everything works fine when I type ionic serve in terminal.
But when I run with ionic run -l and try to open in browser, it redirects me to Firebase Console. Meanwhile on iOS simulator, the project runs perfectly.
Can somebody help me to resolve this issue?
Also, recommend me some hosting to deploy apps with Ionic 2 and Firebase.
Thank you very much!
I have created a starter-kit for Ionic 2, Angular 4 and Firebase 3.
You can check it out here:
https://github.com/Temeteron/ionic2-firebase-starter-kit
I am not really sure what causes your problem. I encourage you to check this starter-kit, maybe Angular 4 will solve this problem.
About the hosting, this tutorial is deployed on app-engine of Google: https://cloud.google.com/appengine/
A have also deployed there, other web applications, either developed on polymer or Ionic 2. I will put the links below, so you can check out the speed of the response and of the connection that app-engine provides freely.
GitCV: https://www.gitcv.com/
Any Counter: https://any-counter.appspot.com/
Best of luck!

Generate apk file for meteor app

I have a project is working for android browser. Is there a way to generate the apk file?
Also, are there anything that I shoud know before generating the apk file?
There are a few steps to follow in order to generate the Android application file (.apk) from a meteor app:
meteor install-sdk android
Have the mobile-config.js file in your project root (mobile-config.js example)
meteor add-platform android
meteor build ~/your-output-dir --server=yourapp.meteor.com
Then you will have your .apk file in ~/your-output-dir/android/unaligned.apk
If you want to proceed and submit to Google Play Store, here are the steps to follow: https://guide.meteor.com/mobile.html#submitting-android
Hope this helps!
You can build an APK file with meteor build command.
Read more about it in the docs: http://docs.meteor.com/#/full/meteorbuild or by typing meteor help build in your terminal.
Starting with Meteor 1.2, the bundled Android tools have been removed and a system-wide install of the Android SDK is now required. This should make it easier to keep the development toolchain up to date and helps avoid some difficult to diagnose failures. The meteor install-sdk command no longer attempts to download and install the Android tools for you (it has been deprecated and just points you to these instructions).
like imslavko says, meteor build works pretty fine, also if you are looking for more information take a look on this Meteorpedia
It work for me
Reegards
As of now playstore has started giving warning while uploading APK about unoptimised bundle and insisting for uploading Android app bundle.
Insted of generating APK why not generate .aab of your project and reduce size of the application.
For people wondering about how to generate .aab for your existing project can read my blog here:
My blog link

Resources