react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Android error “Could not get BatchedBridge, make sure your bundle is packaged properly” on start of app

Open Zygro opened this issue 10 years ago • 77 comments

Solution

Run the following:

react-native run-android
react-native start --reset-cache

Description

After creating a project and not changing a single file, I tried to test it on my 4.4.2. device. I got this red screen right on start of the app and after dismissing it, only white screen was shown instead of welcome message that was supposed to be there.

screenshot_2016-08-10-11-45-29

I also got this error on 5.1.1, but the project worked fine on 6.1.1. Android emulator (for 4.4.2) was also able to display the messages without this redscreen

Edit: On Stack Overflow, user tbo has posted an answer with a workaround. It does work, however it's not ideal as it takes more time http://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly/38874952#38874952

Zygro avatar Aug 10 '16 12:08 Zygro

I get a similar error when trying to run an iOS app using a local build (no dev server): _fbBatchedBridge is undefined. The documentation on running on the device seems to be out of date too.

jacobp100 avatar Aug 10 '16 19:08 jacobp100

Sometimes I got this error when I start clean app (bundle was never downloaded) In most cases there is error in connection between phone and computer. Checking:

  • if adb reverse proxy is set up
  • if packager fucked up
  • if server adress is good (dev settings)

does a thing (solution in SO does work because you upload prebacked apk with bundle inside but idk if watch works for you)

krtr avatar Aug 10 '16 21:08 krtr

I got same error both android device and emulator

brkr avatar Aug 11 '16 07:08 brkr

it helps to me: http://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly

etroynov avatar Aug 11 '16 13:08 etroynov

@T0toro facing the same error, but the info at the link doesn't help me

fisherman818 avatar Aug 13 '16 14:08 fisherman818

react-native run-android
react-native start --reset-cache

st0ffern avatar Aug 13 '16 15:08 st0ffern

Found the solution: react-native start then reload the app.

fisherman818 avatar Aug 13 '16 16:08 fisherman818

I got it to work by changing in the file .buckconfig the line: target = Google Inc.:Google APIs:23 to target = Google Inc.:Google APIs:24

Edited: I was having the same exception on the device Z3 Compact D5803 - 6.0.1 Then i saw in SDK Manager that Android 6.X has api level 24 and not 23, then i changed.

laszl0 avatar Aug 13 '16 16:08 laszl0

@fisherman818 as i said.. @laszl0 should not be a issue. RN is not dependent on API 24

st0ffern avatar Aug 13 '16 21:08 st0ffern

@stoffern yes, you are right. thanks

fisherman818 avatar Aug 14 '16 03:08 fisherman818

This solution on Stack Overflow worked for me: http://stackoverflow.com/a/38874952/1880100

I am only seeing this issue on my 6.0.0 emulator, but not my 4.4.4 emulator

laurakelly avatar Aug 22 '16 23:08 laurakelly

可以看下这个 http://www.geek5.cn/?p=232

calcyu avatar Aug 26 '16 08:08 calcyu

Anyone found the solution? (tried all here... ) I have this problem only for android 5.1

Antibioticvz avatar Aug 29 '16 05:08 Antibioticvz

I had the same problem with a clean installation, and I solved it with http://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly

I think this should be documented.

chespinoza avatar Sep 01 '16 18:09 chespinoza

I had the same issue.

I first needed to run the server react-native start

and then react-native run-android

diegoarcega avatar Sep 02 '16 13:09 diegoarcega

react-native start tells you what's wrong. In my case, there were other processes listening on port 8081. Solved it by getting them:

lsof -n -i4TCP:8081

and then killing them'all.

sergionsz avatar Sep 02 '16 17:09 sergionsz

any feasible solution?

react-native start && react-native run-android is not working for me.

changkun avatar Sep 06 '16 18:09 changkun

@changkun Try to change an emulator device

Antibioticvz avatar Sep 06 '16 23:09 Antibioticvz

@Antibioticvz cool! It works for me, just simply change the emulator from nexus5 to nexus 6.

changkun avatar Sep 07 '16 04:09 changkun

@changkun what the emulator do you use? I've got this problem for Genymotion -> nexus 5 (5.0.0 api21)

Antibioticvz avatar Sep 07 '16 04:09 Antibioticvz