Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Zygro opened this issue Aug 10, 2016 · 77 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Zygro
Copy link

Zygro commented Aug 10, 2016

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

@jacobp100
Copy link
Contributor

jacobp100 commented Aug 10, 2016

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.

@krtr
Copy link

krtr commented Aug 10, 2016

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)

@brkr
Copy link

brkr commented Aug 11, 2016

I got same error both android device and emulator

@etroynov
Copy link

etroynov commented Aug 11, 2016

@fisherman818
Copy link

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

@st0ffern
Copy link

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

@fisherman818
Copy link

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

@laszl0
Copy link

laszl0 commented Aug 13, 2016

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.

@st0ffern
Copy link

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

@fisherman818
Copy link

@Stoffern yes, you are right. thanks

@laurakelly
Copy link

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

@calcyu
Copy link

calcyu commented Aug 26, 2016

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

@Antibioticvz
Copy link

Antibioticvz commented Aug 29, 2016

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

@chespinoza
Copy link

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.

@diegoarcega
Copy link

I had the same issue.

I first needed to run the server
react-native start

and then
react-native run-android

@sergionsz
Copy link

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.

@changkun
Copy link

changkun commented Sep 6, 2016

any feasible solution?

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

@Antibioticvz
Copy link

@changkun Try to change an emulator device

@changkun
Copy link

changkun commented Sep 7, 2016

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

@Antibioticvz
Copy link

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

@changkun
Copy link

changkun commented Sep 7, 2016

@Antibioticvz I was using Genymotion Nexus 5 (6.0.0, API 23), then I followed your suggestion change to Nexus 6 (6.0.0, API 23) everthing works fine.

However, now this error happens again... even to use the nexus 6 emulator...

@flexdhana
Copy link

flexdhana commented Sep 8, 2016

This issue is frustrating me.. i tried in all the devices with Android 4.4, 5.0.1, 6.0.. and getting the same issue "could not get batchedbridge make sure your bundle is packaged correctly".. . please help me to fix.. its working fine in emulator, issue only on actual device.

I am using:
React Native
Android Studio
Android device (4.4, 5.0.1, 6.0)

@etroynov
Copy link

etroynov commented Sep 13, 2016

For physical device in helps to me (in console):
adb reverse tcp:8081 tcp:8081

Environment:

  • Ubuntu 15.10
  • Android studio 2.1.3
  • HTC Desire 626G ( Android 6.0.1 )

p.s app build with android studio

@sumit6b
Copy link

sumit6b commented Sep 15, 2016

This is happening on both of my emulator and mobile device, and none of the solutions working for me, sadly.

@hari2babloo
Copy link

Same Here

@sumit6b
Copy link

sumit6b commented Sep 15, 2016

So I dig a little bit more and found that my <root>/android/app/build/intermediates/assets/debugfolder was empty and by running cd android && ./gradlew assembleDebug was not creating those files required, which are later used by javascript thread in our react native apps.

I ran manually the following command which the debug build command should have created ideally.

node node_modules/react-native/local-cli/cli.js bundle --platform android --dev true --reset-cache --entry-file index.android.js --bundle-output /<path to dir>/android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest /<path to dir>/android/app/build/intermediates/res/merged/debug

After running these commands I found two bundle files in my <root>/android/app/build/intermediates/assets/debug

And then a I ran again cd android && ./gradlew installDebug my app started working again.

@manavdahra
Copy link

@sumit6b Thanks, your solutions works for me.

@arhmnsh
Copy link

arhmnsh commented Sep 21, 2016

This issue also happens if your device is not on the same network as your dev machine.

@liubobuzhidao
Copy link

I created a demo program,and run it on samsung 5.0 successfully, but failed to run on 4.4.4,The error is same with up, I have try to all the methods provided by provider,but no effect!

@jiangqqlmj
Copy link

Android 4.4 OK
when 5.0 or 6.0 this is the same question

@thatsVishal
Copy link

Just uninstall the app and run react-native run-android it worked for me

@sibelius
Copy link

sibelius commented Mar 1, 2017

@Zygro can we close this?

@iroshanAV
Copy link

How can we run app on android v4 devices :( i'm still getting this error

@onstash onstash mentioned this issue Mar 17, 2017
4 tasks
@helloworldtang
Copy link

Solution:
under "react-native" directory:
after run command "./gradlew :Examples:UIExplorer:android:app:installDebug" successfully,
run commnad "./packager/packager.sh" successfuly.
then click "UIExplorer App“ in the emulator or the device

@alfonsogober
Copy link

@sumit6b's solution worked for me, using Bluestacks

@pickfire
Copy link

pickfire commented Apr 7, 2017

It works after I did adb reverse tcp:8081 tcp:8081.

@siddhant91
Copy link

Hello, I am trying to run my react native app but i am not able to resolve the issue "Android error “Could not get BatchedBridge, make sure your bundle is packaged properly” on start of app" , is there any fix for it , i cannot find any solution on web either.

@siddhant91
Copy link

Hi , I also get the below error Execution failed for task ':app:processDebugResources'.

java.io.IOException: Could not delete path

Does anyone has a solution on how can i run the app on emulator ???

@siddhant91
Copy link

@sumit6b your solution worked for me, thanks a lot. But how can i also have hot reload with this, as with your solution i will have to build my app every time when i make any changes.

@devken-net
Copy link

@siddhant91 have you tried this?
https://facebook.github.io/react-native/docs/debugging.html

@ancyrweb
Copy link

@ryanhomer thanks i also had included that Debug thing and I could not load the developer menu anymore, that's great ! 🙌

@nik
Copy link

nik commented Apr 20, 2017

@ryanhomer saved my life. thanks

@Cedrigax
Copy link

Cedrigax commented Apr 25, 2017

@Markortiz you saved my day. Thanks!!
$ adb reverse tcp:8081 tcp:8081

@ravirajn22
Copy link

ravirajn22 commented May 10, 2017

Try this option if you have this problem in android emulator,

open your emulator goto more options present outside the emulator, in that select 'cellular'.
In cellular, try changing Data status (to 'Denied' or 'Home' in my case it was in 'Roaming' which was causing the problem) and reload. You could also try changing Network type and check if its working.

Note: This is just one of the possible solution which worked for me, hence try other solutions if it doesn't work.
All the best..

@yogieputra8
Copy link

@Stoffern Thank you, mate. You saved my day 👍🏻.
I am successfully solved this problem using:

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

@st0ffern
Copy link

why is this still open?
@hramos agree to close it? #9336 (comment) 😉

@xedixermawan
Copy link

this bug happen when I used RELEASE version build config. switch to DEBUG version fix this issue .

@bineeshbabu
Copy link

bineeshbabu commented Dec 7, 2017

This works for me

  1. npm cache clean --force
  2. react-native start
  3. react-native run-android

@JeffLoo-ong
Copy link

This might be useful for someone who is in the same situation I'm in but if you get a "watch" error after attempting to run "react-native start" take a look at the solution by @grit96 fbsamples/f8app#55

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests