[英]React Native images do not show when android device is not connected to PC
So, I only work on my phone since my PC is to slow so it could run emulator... And everything works just fine, my app works just fine when the phone is connected to PC but then, when disconnected again everything works like it should only the images are partially shown. 所以,我只能在手机上工作,因为我的PC速度很慢,因此它可以运行模拟器...而且一切正常,当手机连接到PC时,我的应用程序也可以正常工作,但是当再次断开连接时,一切都可以正常工作应该只显示部分图像。 Example sometimes 50% of images are shown , sometimes 20% etc...
示例有时显示50%的图像,有时显示20%等。
All of the images are local, located src/assets/img/img.jpg
. 所有图像都是本地的,位于
src/assets/img/img.jpg
。 I am using them this way {require("../../assets/img/casper/casperLogo.jpg")}
. 我以这种方式使用它们
{require("../../assets/img/casper/casperLogo.jpg")}
。
I have maybe 50-60 up to 50kb images, I plan to have much more of them... 我可能有50至60个最多50kb的图像,我计划有更多的图像...
Is this some cash memory problem or what? 这是一些现金存储问题还是什么? Is this because app is still in the development?
这是因为应用仍在开发中吗? Sometimes when the phone is disconnected, all images are shown for maybe couple of hours, but then they are gonne again, until I build the app once again...
有时,当手机断开连接时,所有图像可能会显示几个小时,但随后它们又变了,直到我再次构建该应用程序为止。
Any suggestion? 有什么建议吗?
Thanks in advance. 提前致谢。
I assume this has something to do with the bundling of react native. 我认为这与react native的捆绑有关。 So did you test it in production?
那您在生产中测试过吗?
If I am not wrong it should work when both devices (PC and phone) are in the same network. 如果我没记错的话,当两个设备(PC和电话)都在同一网络中时,它应该可以工作。
The background is that your App is bundled on your computer and provided as an service for your phone. 背景是您的应用程序捆绑在计算机上,并作为手机的服务提供。 So when your phone is connected with the metro (the bundle service) it is downloading the bundle and starting the App.
因此,当您的手机与都市圈(捆绑服务)连接时,它将下载捆绑并启动应用程序。 Good for debugging ;)
适合调试;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.