简体   繁体   中英

Android Studio can not 'react-native start', How to fix it?

There are 4 way to run React Native APL.

  • react-native run-android
  • react-native run-iso
  • XCODE
  • Android Studio

    react-native start works with another terminal screen,on react-native run-android , react-native run-iso , XCODE . But Android Studio does not work, and error is as follows.

[ 12-14 14:02:59.506 2905: 2928 E/ ] Unable to load script from assets: index.android.bundle E/unknown:React: Exception in native call from JS com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is packaged correctly at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:761) Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatch Message(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:761) W/unknown:React: Packager connection already open, nooping. W/unknown:React: Calling JS function after bridge has been destroyed.

Is there any fix on this error?

Thanks Shoji

I found the workaround for Android Studio.

on the terminal windows, do "react-native start"

then reload the app in Android Studio.

This work for me to debug React Native APL on Android Studio.

But My original question was, In Android Studio, run command can not start package manager automatically like XCODE dose.

Is there anyone to get work run with "start package manager automatically"? like XCODE dose.

Thanks

Shoji

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM