反应,原生的Android无法加载JS包:在index.android.js变化不能看的apk [英] React-native android failed to load js bundle:Changes in index.android.js can't see in apk
问题描述
我设置的反应,原生的Android项目在我的Windows机器,运行我使用这个命令反应本地运行的Android
,我会得到安装APK在我的手机上。
I've setup react-native android project in my windows machine,for running i am using this command react-native run-android
and i will get the installed apk in my phone.
现在我取得了 index.android.js
来看到的变化,我会从愤怒preSS刷新JS动摇menu.But我会得到一些改变下面的错误。
Now i made some changes in index.android.js
to see the changes i'll press Reload JS from the rage shake menu.But i will get the following error.
无法下载JS bundle.Did你忘了启动开发
服务器或连接设备?
Unable to download js bundle.Did you forget to start the development server or connect your device?
我试过从溶液<一个href=\"http://stackoverflow.com/questions/32572399/react-native-android-failed-to-load-js-bundle\">this但它不是为我工作,我也已经设置调试服务器主机设备
与我的机器Ipadress但我以前不工作。
I've tried the solution from this but its not worked for me,also I've setup Debug server host for device
with my machine Ipadress but it did't work.
注意:
Android版本是5 +
Android version is 5+
推荐答案
终于让我找到解决方案执行以下分步
Finally i found the solution Do the following step by step
1.Go项目目录,使用命令你执行反应本地运行的Android
。
1.Go to project directory and Run your using the command react-native run-android
.
在2.open同一目录下一个命令提示符,运行命令反应母语启动
2.open another command prompt in same directory and run the command react-native start
3.Open 用于设备调试服务器主机
从愤怒摇菜单选项和8081端口设置ip地址如:192.168.1.23:8081
3.Open Debug server host for device
option from rage shake menu and set the ipaddress with port 8081 eg:192.168.1.23:8081
现在你可以看到在应用index.android.js的变化
Now you can see the changes of index.android.js in your app
注意
有关获取IP地址使用 IPCONFIG
命令,如果在你的开发设置中启用重加载选项,你可以看到即时的改变,而无需使用Reloadjs。
For getting ip address use ipconfig
command ,if you enable live reloading option in your dev settings you can see instant changes without using Reloadjs.
这篇关于反应,原生的Android无法加载JS包:在index.android.js变化不能看的apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!