1

I have recently published an app on PlayStore and I had a problem with my React Native "android Only" version as follows:

A- Status in Debug Mode:

The app would gives this error in both emulator and real android device and on a different IP other than my localhost as described in my /etc/hosts:

// Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner})

It would only open if I: 1- Run the debugger on "http://localhost:8081/debugger-ui" 2- run "react-native run-ios" 3- Enable "Debug JS Remotely".

I was advised that this problem would disappear on production, so I launched the app and the problem as follows:

B- Problem at Production Mode

App would install perfectly and when I launch the app I get the following error:

com.facebook.react.common.JavascriptException: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}).

package.json

"dependencies": { "firebase": "^5.8.4", "prop-types": "^15.7.2", "react": "16.6.3", "react-native": "0.58.5", "react-native-gesture-handler": "^1.0.16", "react-native-vector-icons": "^6.3.0", "react-navigation": "^3.3.0" },

environment info

React Native Environment Info: System: OS: macOS 10.14.3 CPU: (8) x64 Intel(R) Core(TM) i7-3635QM CPU @ 2.40GHz Memory: 44.27 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.10.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.8.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 28 Build Tools: 28.0.3 System Images: android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.5 => 0.58.5 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7

Any support is extremely appreciated.

Best Regards,

1
  • Do you use firebase? if it is yes, post the code example of how do you export it please. Commented Mar 6, 2019 at 11:21

1 Answer 1

1

Probably you are not importing firebase in the correct way. Try to import firebase this way instead of how are you doing right now:

import firebase from '@firebase/app'
import '@firebase/auth'
Sign up to request clarification or add additional context in comments.

5 Comments

I did and it fixed the problem, Thank you Very much. Eslint says "@firebase/app" should be listed in the project's dependencies" Do you advise me to update the package.json to it as it advise?
I'm glad to hear that! I wouldn't touch anything if it still work so, nope, essentially because I'm not an expert of that to advise you. Anyway, if this worked for you, set this as correct answer. Greetings!
I would gladly do that, can you tell me how to set it as the correct answer please?
There is a "check icon" in this answer where you can click and set this the correct answer if am not wrong. It is below the point of the answer
Thank you Sir. Have a great day!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.