反应,原生的Andr​​oid无法加载JS包:在index.android.js变化不能看的apk [英] React-native android failed to load js bundle:Changes in index.android.js can't see in apk

查看:563
本文介绍了反应,原生的Andr​​oid无法加载JS包:在index.android.js变化不能看的apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置的反应,原生的Andr​​oid项目在我的Windows机器,运行我使用这个命令反应本地运行的Andr​​oid ,我会得到安装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项目目录,使用命令你执行反应本地运行的Andr​​oid

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.

这篇关于反应,原生的Andr​​oid无法加载JS包:在index.android.js变化不能看的apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆