Could not get BatchedBridge, make sure your bundle is packaged correctly
最近在原生Android專案中整合React Native環境時,頻繁出現 com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is packaged correctly的錯誤,詳細報錯資訊如下:
10-18 09:42:47.280 18014-18014/com.wwy.jichengrnapplication E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist! 10-18 09:42:47.283 18014-18014/com.wwy.jichengrnapplication E/Minikin: Could not get cmap table size! 10-18 09:42:47.394 18014-18034/com.wwy.jichengrnapplication E/iGraphicsGLIntercept: failed to load file: /product/etc/xml/igraphics_config_cust.xml 10-18 09:42:48.589 18014-18063/com.wwy.jichengrnapplication 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:808) at android.os.Handler.dispatchMessage(Handler.java:101) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:166) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:784) 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:808) at android.os.Handler.dispatchMessage(Handler.java:101) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:166) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:784) 10-18 09:42:48.602 18014-18063/com.wwy.jichengrnapplication E/unknown:React: Exception in native call java.lang.RuntimeException: Error calling function: RCTDeviceEventEmitter:emit at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:166) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:784) Caused by: java.lang.RuntimeException: Empty Optional cannot be unwrapped at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:166) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:784) 10-18 09:42:48.607 18014-18063/com.wwy.jichengrnapplication E/unknown:React: Exception in native call java.lang.RuntimeException: Error calling function: AppRegistry:runApplication at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:166) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:784) Caused by: java.lang.RuntimeException: Empty Optional cannot be unwrapped at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:166) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:784) 10-18 09:42:48.659 18014-18014/com.wwy.jichengrnapplication E/AndroidRuntime: FATAL EXCEPTION: main Process: com.wwy.jichengrnapplication, PID: 18014 android.view.WindowManager$BadTokenException: Unable to add window
[email protected] -- permission denied for window type 2003 at android.view.ViewRootImpl.setView(ViewRootImpl.java:908) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:372) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:128) at android.app.Dialog.show(Dialog.java:454) at com.facebook.react.devsupport.DevSupportManagerImpl$4.run(DevSupportManagerImpl.java:332) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7425) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
經檢查我的package.json和index.android.js檔案均沒有語法錯誤,然後也確認我index.android.js、package.json、RNactivity檔案中的getMainComponentName方法返回的那個值三者一致。然而並無卵用,跳轉到RN頁面後仍然是全白頁面或者這樣的紅色頁面,雙擊R鍵也沒用,重新啟動應用也沒用。
最後我進入到專案根目錄下cmd命令執行 npm start 開啟react-native的package,參照下圖執行:
待package如上圖啟動成功後點擊進入RN介面,開啟在APP上層顯示許可權,再回到app中仍然無效。
最後看到一篇文章說需要生成本地bundle檔案,解決辦法是:
在當前工程根目錄下開啟cmd執行:react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
注意根據各自工程名字可能有不同程式的修改,
注意如果工程沒有/android/app/src/main/assets
檔案,需要先建立。
如上圖資訊則成功生成了如下的兩個bundle檔案
這樣就完美解決了,重新執行應用,就正確進入了RN頁面了。
相關推薦
Could not get BatchedBridge, make sure your bundle is packaged correctly
最近在原生Android專案中整合React Native環境時,頻繁出現 com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is packaged c
安卓嵌入react native 環境的步驟,Could not get BatchedBridge, make sure your bundle is packaged correctly問題的解決
條件: 安卓。 今天給原生嵌入react native的環境時突然就出現了這個錯誤。點選reload就直接說連不上伺服器。 先說步驟吧。 1. 在app/build.gradle中加入依賴。compile'com.facebook.re
Could not get BatchedBridge, make sure your bundle is packaged correctly
最近在原生Android專案中整合React Native環境時,頻繁出現 com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is pac
【React Native】React Native之Could not get BatchedBridge,make sure...的問題
下載了一個專案,npm install安裝之後,再次執行,卻出現Could not get BatchedBridge,make sure your bundle is packaged correctly的錯誤。 長這個樣: 先說解決方法: 1 .
Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctl
第一種:使用bundle命令:(缺點:後續沒辦法reload,只能重複生成bundle檔案) 1.在Android/app/src/main目錄下建立一個空的assets資料夾 2: 在工程根目錄下資料bundle命令: react-native bundle --platform
unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correct
第一步:在 android/app/src/main 目錄下建立一個 assets空資料夾 第二步:執行 下面這段命令 react-native bundle –platform andr
React-native打包遇到問題:Could not get BatchedBridge
打包後使用時仍然找不到js bridge 需要在根目錄使用命令: react-native bundle --platform android --dev false --entry-file
Kettle 連線 oracle 報錯:could not be found, make sure the 'Oracle' driver (jar file) is installed.
報錯如下:Driver class 'oracle.jdbc.driver.OracleDriver' could not be found, make sure the 'Oracle' driver (jar file) is installed.oracle.jdbc.
unable to load script from assets ‘index.android bundle’ ,make sure your bundle ...
unable to load script from assets ‘index.android bundle’ ,make sure your bundle is packaged correctly or youu’re runing a packager
ubuntu常見錯誤--Could not get lock /var/lib/dpkg/lock解決
nbsp 程序 被鎖 終端 nis cto not pro -- ubuntu常見錯誤--Could not get lock /var/lib/dpkg/lock解決 通過終端安裝程序sudo apt-get install xxx時出錯: E: Could no
使用命令:ssh-add 時,出現 “Could not open a connection to your authentication agent.”
col cti ash agent str cati authent b- then 為 GitHub 賬號設置 SSH Key時, 使用命令:ssh-add,出現“Could not open a connection to your authentication age
java 連接 redis集群時報錯:Could not get a resource from the pool
rom idt log 圖片 pool 本機ip redis style exce 由於弄這個的時候浪費了太多的時間,所以才記錄下這個錯,給大夥參考下 檢查了一下,配置啥的都沒問題的,但在redis集群機器上就可以,錯誤如下: Exception in thread "
開發手記:JedisConnectionException: Could not get a resource from the pool
nfa 最大連接數 redis color 重試 direction str bsp blog 對於Redis,生產環境是集群模式,測試環境是單例模式,如果在生產環境中用單例模式會報錯。 解決辦法,通過雲配置,將配置進行自動化配置。 另附一份Redis配置: #****
UBUNTU Could not get lock /var/lib/apt/lists/lock
apt clas update not 終端 pda sts 沒有 killall ps -e | grep apt 顯示結果如下: 6362 ? 00:00:00 apt 6934 ? 00:00:00 apt-get 7368 ? 00:00:00 synaptic 然
關於Ubuntu中Could not get lock /var/lib/dpkg/lock解決方案
dmi 方案 殺死進程 class 關於 OS 鎖死 解決方案 序號 如果運行sudo apt-get install*****,出現: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource tempor
redis.clients.jedis.exception.JedisConnectionException:Could not get a resource from the pool
class verbose 沒有 mage resource open conf bubuko uri 啟動項目報該異常。原因是因為該項目是需要啟動redis的,報錯原因是因為沒有安裝redis或者沒有手動啟動redis,把redis設置成自啟動就行了 一、下載window
dubbo could not get local host ip address will use 127.0.0.1 instead 異常處理
ddr not 查看 文件 cal res ip add address 異常 dubbo could not get local host ip address will use 127.0.0.1 instead 查看hostname 修改hosts文件 vi /et
Ubuntu中針對問題 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)的解決方案
ins 再次 apt-get cto roc 圖片 ESS left all 一、問題描述: 在ubuntu中有時因為錯誤的操作,而導致在執行 sudo apt-get install xxxx出現如下錯誤: E: Could not get lock
Android Studio Could not GET gradle-3.2.0.pom (安卓包配置相關問題)
could 9.png too spa not pom .com sharp 安卓 安卓出現的錯誤如下 Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradl
錯誤筆記: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration di
不能 ava 可用 pro virtual cache 出現 nav ive 親測可用 --jack alexander@alexander-virtual-machine:~$ sudo apt-get install -y httpdE: Could not get