Red Screen React Native Reference Error : Can't find variable : _fbBatchedBridge - javascript

I followed the steps mentioned in following documents and everything runs perfectly.
https://facebook.github.io/react-native/docs/getting-started.html
https://facebook.github.io/react-native/docs/android-setup.html
https://facebook.github.io/react-native/docs/running-on-device-android.html
Now am trying to run the android app on my device but I get below error.
I tried following to resolve the issue:
react-native start > /dev/null 2>&1 &
adb reverse tcp:8081 tcp:8081
If I try to run without a server, bundle the jsfile into the apk by running:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
I get
I followed all the steps outlined in this question react native android failed to load JS bundle but still I am not able to resolve the issue.
I am using my smartphone's data plan on my OSX machine via hotspot. I entered my machine's IP address inet 192.168.43.14 along with port 8081 in the react-native developer setting.
Any idea what am missing here?
Device details:
OSX El Capitan 10.11.1
Nexus 5(Rooted) 6.0.1
Node - v4.2.1

Related

Could not connect to development server. - Expo

I am attempting to get a mobile app to run using expo and whenever I run the simulator I get the following error.
One of the recommended solutions is to set the URL correctly in AppDelegate, and I have already tried to find this file and look at solutions on the web but I cannot even find the AppDelegate.m file to do this.
Do you know where it is and how I could update the file to fix my code?
Thank you!
Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
- WiFi is enabled and connected to the same network as the Node Server
URL: http://192.168.1.90:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false
ABI44_0_0RCTFatal
__37-[ABI44_0_0RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0

"which adb" command shows the path of adb but "adb devices" says no such file or directory

I'm practicing REACT NATIVE on UBUNTU 18.x OS, everything was running smooth, yesterday i updated my React native,react & android gradle versions then i recived some error like server adb & client adb doesn't match, i fixed this issue using some commands now once the new project run fine, but as soon as i rebooted my system & run the project,it thrown the error
then i checked adb
+adb
output:bash: /usr/bin/adb: No such file or directory
+which adb
output:/usr/bin/adb
+type adb
output:adb is hashed (/usr/bin/adb)
+adb devices
output:bash: /usr/bin/adb: No such file or directory
please help me to resolve this error!
To my knowledge it can be resolved by increasing the num of max users in sysctl.conf
on UBUNTU you can run
sudo nano /etc/sysctl.conf
then press ctrl+O
then press ENTRE
then take the cursor on the end of file and place this line there
fs.inotify.max_user_watches=100000
or simply run this command
sudo sysctl -w fs.inotify.max_user_watches=100000
you can also follow this
no-command-adb-found-error-on-ubuntu

ReactNative port 8081 issue : 403 Forbidden

While developing using ReactNative on Windows, I am getting below 403 error. This is because port 8081 which ReactNative uses by default is being used by another program. In my case it was McAfee (Thanks McAfee for making this harder).
Command to run the project : react-native run-android
I searched around a lot and finally figured out how to run this project on a different port. If you have any Antivirus software installed then it may help if you disable the firewall while developing or allow connections manually through settings.
Start ReactNative on a different port
react-native start --port 9080
This will open a new command prompt and start the metro bundler on port 9080 (you can use any other port you want). Wait for the dependency graph to be fully loaded.
Now in a different command prompt (project directory) use the below command to build and install the app on device
react-native run-android
Now once the app is loaded on device you will see the 403 error along with the red screen. To make the device communicate on a different port use below command.
adb reverse tcp:8081 tcp:9080
or if you have multiple device connected then provide the device id (e.g. FA6AA0301277)
adb -s FA6AA0301277 reverse tcp:8081 tcp:9080
To know the list of devices connected use below command
adb devices
That's it, now you should be able to see the index page :)
Happy Coding :)

Node.js Setup Wizard ended Prematurely on Windows 10 64 bit

I tried to install Node.js Setup for the first time (node-v8.9.1-x64 and node-v9.2.0-x64) on a system running Windows 10 64-bit , but it is giving the dreaded error
Node.js Setup Wizard ended Prematurely
Failed Attempts
Launching .msi from Command Prompt ran as Administrator
Disabling the installation options
Performance Counters
Event Tracing
Online Document Shortcuts
Registry Key Search
No registry keys were found when running the following
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\_V2Providers\{793c9b44-3d6b-4f57-b5d7-4ff80adcf9a2}" /s
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\_V2Providers\{1e2e15d7-3760-470e-8699-b9db5248edd5}" /s
The installation log shows an error status: 1603. [View Installation Log]
Node is not installed
node -v
Output:
'node' is not recognized as an internal or external command, operable program or batch file.
Attempt 3
Tried the following based on Github issue #4329, but theres no output after running this.
msiexec /i node-v8.9.1-x64.msi /qn+ ADDLOCAL=ALL REMOVE=NodePerfCtrSupport,NodeEtwSupport
Any ideas how to solve this problem?

React native running on the device error

my react native app wont run when the device is connected on my laptop.. but the app will run successfully on genymotion. I dont know what the problem is. Can anyone suggest me some solutions to this problem. Thank you
This is problem i get on my device, but no problem when running on genymotion
check this out, probably you not set up your dev server
https://facebook.github.io/react-native/docs/running-on-device-android.html#configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi
Make sure your laptop and your phone are on the same Wi-Fi network.
Open your React Native app on your device. You can do this the same way you'd open any other app.
You'll see a red screen with an error. This is OK. The following steps will fix that.
Open the Developer menu by shaking the device or running adb shell input keyevent 82 from the command line.
Go to Dev Settings.
Go to Debug server host for device.
Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). On Mac, you can find the IP address in System Preferences / Network. On Windows, open the command prompt and type ipconfig to find your machine's IP address (more info).
Go back to the Developer menu and select Reload JS.
what your android version device ?
the first think should you do after your plugg in your device via usb, check that your device is properly connecting to ADB by running adb devices.
Open your cmd find your adb directory path example : C:\Users\your_name\AppData\Local\Android\sdk\platform-tools
Run $ adb devices and see list devices attached. U must have one devices only one device connected at a time.
After check devices are connected and then run your app $ react-native run-android.
If your android version 5.0 lollipop running the following in your cmd $ adb reverse tcp:8081 tcp:8081 and you can reload your aplication, but if still error you can run via wi-fi, you can use this tutorial if you run via wi-fi, but you'll first need to install the app on your device using a USB cable.

Categories

Resources