1. 程式人生 > >react-native---配置reactnative報紅,run-Android時候報錯unable to load script from assets 'index.android.bundl

react-native---配置reactnative報紅,run-Android時候報錯unable to load script from assets 'index.android.bundl

配置react-native環境時候報錯:

unable to load script from assets 'index.android.bundle'.Make sure your bundle ispackged correctly or you are running a packger server.

如圖:

這裡寫圖片描述

百度了很久,好像沒有多少真正對症的方法。

去stackoverflow看了很多帖子,也是一個個試,最後發現一個不是最佳的回覆挺有道理,試了一下果然OK。
這裡寫圖片描述

說是新版本檔名已經從index.android.js變為了index.js;

至於assets資料夾就是用來存放index.android.bundle等檔案用;

按照步驟:

1 新建assets

進入\android\app\src\main
新建assets資料夾

2 修改entry–file

根目錄cmd執行命令:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

3 執行run-android

重新執行run-android

此時,結果為:
這裡寫圖片描述

借鑑

相關推薦

react-native---配置reactnativerun-Android時候unable to load script from assets 'index.android.bundl

配置react-native環境時候報錯: unable to load script from assets 'index.android.bundle'.Make sure your bundle ispackged correctly or you

react-native 啟動的時候unable to load script from assets 'index.android bundle'

實行命令react-native run-android報以下錯誤 unable to load script from assets 'index.android bundle'  ,make su

win10 windows10 react-native rn 環境安裝配置Unable to load script from assets 'index.android.bundle終極解決方案

首先說明一下我的情況,新手開始學rn,之前只看過阮一峰大神和一個翻譯國外react入門的文章,然後直接開始rn配置,也是一步一步看著網上的教程開始的,剛開始問題太多,沒有寫中間的bug,直到最後這一個bug搞了我半個下午半個上午,今天上午終於看到期望已久的hello wor

React-native 完美解決 Unable to load script from assetsindex.android.bundle” 和 JS server not recognize

前言: React-Native的第一個HelloWorld工程,大多數人都能跑起來,可也有一部分人卡在第一個工程,就是難以跑出正確的介面,乾著急… 我這裡給出我遇到的坑,希望能夠幫助你,首先,給出我現在的開發環境版本: 版本宣告: Node.js : v8.9.4 Re

Mac中真機測試React Native project時出現Unable to load script from assets 'index.android.bundle'

剛接觸學習React Native,在進行真機除錯時,報錯出現Unable to load script from assets ‘index.android.bundle’. Make sure your bundle is packaged correctl

React Native 學習之路:Unable to load script from assets 'index.android.bundle'.

 最近總遇到這個問題:問題背景:1.伺服器已啟動2.裝置插入了兩個裝置(模擬器與真機)3.之後出現以下報錯問題Unable to load script from assets 'index.android.bundle'. Make sure your bundle is

react-native 啟動的時候unable to load script from assets 'index.android bundle'

實行命令react-native run-android報以下錯誤 unable to load script from assets 'index.android bundle'  ,make sure your bundle is packaged correctly or y

React Native for Android Nnable to load script from assets 'index.android bundle'

在android手機上執行react-native專案時 報錯:unable to load script from assets 'index.android bundle'  ,make sur

[React-Native] Unable to load script from assets 'index.android.bundle'.

unable als android win oid .com -i ets ava react native for android 拋出下面異常,解決方法: java.lang.RuntimeException: Unable to load script from

(轉)react-native unable to load script from assets

轉載自:https://blog.csdn.net/jasonzds/article/details/78747524問題:unable to load script from assets ‘index.android bundle’ ,make sure your bun

ReactNative--出現異常的解決方法:Unable to load script from assets 'index.android.bundle'

當我們搭建環境,執行第一個專案時手機介面出現紅色背景,這說明報異常了,不能正常編譯。我是在真機上進行的測試出現的問題。廢話不多說,上正題。 首先先說一個問題我這個是新版本建立的專案,此時專案根目錄是沒有index.android.js檔案的,我看網上說手動複製index.js重新命名一個

unable to load script from assets-ReactNative新建專案採坑

1.開啟專案根目錄下的package.json        看下 版本號是不是0.56.0,是的話改成0.55.4; 2.劃重點 某個main資料夾下新建assets,你肯定知道是哪個main,做過好多次了就是沒用罷了。 react-native bun

react native unable to load script form assets 錯誤解決

注意:虛擬機器unable to load script form assets,可能是8081埠被佔用 真機除錯如果紅色錯誤錯誤 unable to load script form assets解決 1: android\app\src\main 下新建asse

vue+cordova開發webapp安裝cordova camera外掛所遇到的坑(Unable to load PlatfomApi from platform......Api.js)

最近老闆讓我用phonegap平臺和vue框架開發一個webapp的一個上傳頭像的介面,初次接觸phonegap,從安裝到使用遇到了好多坑,也查了很多的資料,首先安裝以及配置環境就不多說了大家可以參考: https://blog.csdn.net/webxiaoma/article/de

struts :Unable to load configuration. - action 的解決

  初學Struts, 在idea裡寫Struts專案, 其實還是挺好操作的,   從官網下載min 的jar包, 然後在idea 裡 新建Struts專案的時候 就可以選擇用本地包來構建,   ctrl shift alt s 配置專案的libraries, 等等在此不表   但是在啟動tomca

PyCharm出現錯誤Fatal Python error: Py_Initialize: unable to load the file system codec ModuleNotFound。。

借鑑如下的部落格:https://blog.csdn.net/qq_41574830/article/details/81153096 1.找到你安裝的python.exe,記住此地址 2.在Pycharm找到file--->setteing--project Interpret

IP欺騙 Unable to load summary dialog -1 Please register richtx32.ocx 解決辦法

建立IP欺騙的時候loadrunner報錯 Unable to load summary dialog -1 Please register richtx32.ocx解決辦法:1.開始—執行,輸入“cmd”回車2. 輸入“Regsvr32 C:\Windows\System3

React-Native 集成個推需要註意的地方

activit ive 方法 手動 creat nac activity ati push 1, 安卓,可能需要手動寫覆蓋onCreate的方法 註意: 有可能您的MainActivity中未重寫onCreate方法,如果未重寫,請重寫onCreate方法,方法如下

React Native調試實用技巧React Native開發者必會的調試技巧

黃色 系列 保持 ont 學習筆記 block 有效 poi ges 在做React Native開發時,少不了的需要對React Native程序進行調試。調試程序是每一位開發者的基本功,高效的調試不僅能提高開發效率,也能降低Bug率。本文將向大家分享React Nati

react native中封裝別的外掛在父元件中呼叫子元件的ref

話不多說,直接上程式碼: 父元件中: import MyToast from '../../myToast'; <MyToast onRef={toast => this.toast = toast} position="center" /> 子元件中: impor