Running the newest version of RN, I get the below error. It only occurs however on a physical Android device (tried two different ones) - Android simulators and iOS are fine.
Any ideas on whether this is some kind of caching issue (which I doubt based on all my clearing techniques) or a code error?
I have tried following advice on questions that are reasonably similar to this, but no luck.
Worth noting that I have mobx installed which has caused this error message before, although it has always shown to come from there rather than showing unknown in the error's description.
Many thanks!
In Android Studio I get this error (unsure if the two are related):
E/ReactNativeJS: Can't find variable: Symbol E/ReactNativeJS: Module AppRegistry is not a registered callable module (calling runApplication)
React Native Error Screenshot:
I was having trouble setting up mobx
and mobx-react
on my project, created using react-native init
.
I was having this very similar problem when running on my physical device, an Android Samsung J7 Pro.
At the end, it was about not installing mobx
properly.
At first, I was getting the following black screen error: https://i.stack.imgur.com/ExSlC.png
Then after 1~2 seconds, this screen would turn to the following: https://i.stack.imgur.com/D74Ia.png
MobX >=5 is not supposed to run straight forward on React Native Android. Then I just had to make sure to follow these steps to get it running:
brew install coreutils
npm install jsc-android --save
libjsc.so
.npm install --save-dev @babel/plugin-proposal-decorators
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": true }]
]
}
Here is my package.json file:
{
"name": "mobx_testing",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"jsc-android": "^236355.1.1",
"mobx": "^5.9.0",
"mobx-react": "^5.4.3",
"react": "16.6.3",
"react-native": "0.58.5"
},
"devDependencies": {
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "24.1.0",
"@babel/plugin-proposal-decorators": "^7.3.0",
"jest": "24.1.0",
"metro-react-native-babel-preset": "0.52.0",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With