【发布时间】:2018-03-31 19:15:44
【问题描述】:
所以,首先...在 iOS 上运行没有问题。我在
“反应”:“16.0.0-beta.5”,
"react-native": "^0.49.3",
在物理设备或模拟器上尝试 react-native run-android 时出现以下错误。
我还尝试删除和重新安装节点模块,清除 npm 缓存,清理 android 构建。这些东西都不能解决这个问题。
如果我转到错误中的 url,则有一个 JS 页面。该应用程序还会锁定设备或模拟器。
其他信息:
adb 是我的路径,我可以运行 adb devices。
adb reverse tcp:8081 tcp:8081 没有帮助
10-19 12:28:20.839: E/unknown:ReactNative(12782): Exception in native call from JS
10-19 12:28:20.839: E/unknown:ReactNative(12782): com.facebook.react.devsupport.JSException: Unexpected token '*' (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:112538)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at android.os.Handler.handleCallback(Handler.java:751)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at android.os.Handler.dispatchMessage(Handler.java:95)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at android.os.Looper.loop(Looper.java:154)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
10-19 12:28:20.839: E/unknown:ReactNative(12782): at java.lang.Thread.run(Thread.java:761)
10-19 12:28:20.839: E/unknown:ReactNative(12782): Caused by: com.facebook.jni.CppException: Unexpected token '*' (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:112538)
10-19 12:28:20.839: E/unknown:ReactNative(12782): ... 7 more
10-19 12:28:20.841: E/unknown:ReactNative(12782): Exception in native call
10-19 12:28:20.841: E/unknown:ReactNative(12782): java.lang.RuntimeException: Error calling AppRegistry.runApplication
10-19 12:28:20.841: E/unknown:ReactNative(12782): at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-19 12:28:20.841: E/unknown:ReactNative(12782): at android.os.Handler.handleCallback(Handler.java:751)
10-19 12:28:20.841: E/unknown:ReactNative(12782): at android.os.Handler.dispatchMessage(Handler.java:95)
10-19 12:28:20.841: E/unknown:ReactNative(12782): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
10-19 12:28:20.841: E/unknown:ReactNative(12782): at android.os.Looper.loop(Looper.java:154)
10-19 12:28:20.841: E/unknown:ReactNative(12782): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
10-19 12:28:20.841: E/unknown:ReactNative(12782): at java.lang.Thread.run(Thread.java:761)
10-19 12:28:20.841: E/unknown:ReactNative(12782): Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
10-19 12:28:20.841: E/unknown:ReactNative(12782): ... 7 more
【问题讨论】:
标签: react-native react-native-android