Home » Android » Android react native couldn't get batched bridge

Android react native couldn't get batched bridge

Posted by: admin June 15, 2020 Leave a comment

Questions:

Am trying to run my first react native project but am getting error

“Couldn’t get batched bridge, make sure your package is bundled correctly”

Please help me to fix it- Am using windows machine

How to&Answers:

I had the same issue. Follow these steps for the resolution in your project’s folder:

react-native start

This might take a while. Output will look like this:

Scanning 581 folders for symlinks in /home/shantanu/react-native/AwesomeProject/node_modules (5ms)
 ┌────────────────────────────────────────────────────────────────────────────┐ 
 │  Running packager on port 8081.                                            │ 
 │                                                                            │ 
 │  Keep this packager running while developing on any JS projects. Feel      │ 
 │  free to close this tab and run your own packager instance if you          │ 
 │  prefer.                                                                   │ 
 │                                                                            │ 
 │  https://github.com/facebook/react-native                                  │ 
 │                                                                            │ 
 └────────────────────────────────────────────────────────────────────────────┘ 
Looking for JS files in
   /home/shantanu/react-native/AwesomeProject 

[10/3/2016, 12:49:34 PM] <START> Building Dependency Graph
[10/3/2016, 12:49:34 PM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot

React packager ready.

[10/3/2016, 12:49:47 PM] <END>   Crawling File System (12440ms)
[10/3/2016, 12:49:47 PM] <START> Building in-memory fs for JavaScript
[10/3/2016, 12:49:47 PM] <END>   Building in-memory fs for JavaScript (123ms)
[10/3/2016, 12:49:47 PM] <START> Building in-memory fs for Assets
[10/3/2016, 12:49:47 PM] <END>   Building in-memory fs for Assets (90ms)
[10/3/2016, 12:49:47 PM] <START> Building Haste Map
[10/3/2016, 12:49:47 PM] <START> Building (deprecated) Asset Map
[10/3/2016, 12:49:47 PM] <END>   Building (deprecated) Asset Map (38ms)
[10/3/2016, 12:49:47 PM] <END>   Building Haste Map (773ms)
[10/3/2016, 12:49:47 PM] <END>   Building Dependency Graph (13551ms)
^[[B


[10/3/2016, 12:50:35 PM] <START> Requesting bundle: {"url":"/index.android.bundle?platform=android&dev=true&hot=false&minify=false"}
[10/3/2016, 12:50:35 PM] <START> Finding dependencies
transformed 636/636 (100%)
[10/3/2016, 12:50:45 PM] <END>   Finding dependencies (9503ms)
[10/3/2016, 12:50:48 PM] <END>   Requesting bundle: {"url":"/index.android.bundle?platform=android&dev=true&hot=false&minify=false"} (13130ms)

Once this is over run this:

react-native run-android

Answer:

I had the same problem in a Windows machine when following the Getting Started tutorial, and using Visual Studio Emulator for Android.

In my case, I found out that it was failing because it couldn’t find adb when building the app, so I solved it by adding the Android SDK Platform Tools folder to my PATH. Check that you have it! 🙂

Answer:

If people are still looking for solution. (Please note this works for devices with android 5.0 or greater)

This link clearly explains how to run in device.

To install and launch your app on the device, you need to run the following adb command (which connects to the development server running on your development machine)

$ adb reverse tcp:8081 tcp:8081

For Mac users:–

1. Go to Library/Android/sdk/platform-tools
2. ./adb reverse tcp:8081 tcp:8081

For Windows users:-

1. Go to C:\Users\<username>\AppData\Local\Android\sdk\platform-tools
2. adb reverse tcp:8081 tcp:8081

Answer:

I was having the same issue-
What worked for me:
1. Open the app in the android device.
2. Shake it(to reload)
3. Then, on the menu click on dev settings
4. Then click on Debug server host & port for device
5. Enter your computer’s IP followed by port(viz 8081 normally). e.g. 192.168.0.3:8081
6. RELOAD. Voila! It worked.