Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android react native couldn't get batched bridge

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

like image 686
Bytecode Avatar asked Aug 25 '16 05:08

Bytecode


2 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
like image 125
Shantanu Bhadoria Avatar answered Nov 04 '22 04:11

Shantanu Bhadoria


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! :)

like image 42
elbecita Avatar answered Nov 04 '22 03:11

elbecita