简体   繁体   English

当Android设备未连接到PC时,React Native图像不显示

[英]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.

相关问题 图像未显示在 Android 设备上反应原生 expo - Images are not showing on Android device on react native expo 当我在我的设备中运行我的React Native应用程序而未通过电缆在PC上连接时,它显示了2个月前的应用程序状态 - When I run my React Native app in my device without connecting on the pc via cable, it show the app state 2 month ago 如何检查是否有任何蓝牙设备以反应本机连接 - How to check if any bluetooth device is connected in react native 我想获取存储在 android 设备中的所有图像,以将它们显示到我的 React Native 应用程序中 - I want to get all the images stored in an android device to display them into my React Native app 无法在本机反应中显示多个图像 - Unable to show multiple images in react native React Native Customized Image Picker 不在 android 上显示图库图片 - React Native Customized Image Picker doesn't show gallery images on android react native 无法连接到安卓设备 - react native can't connect to android device React Native PanResponder 不适用于 Android 设备 - React Native PanResponder not working on Android device 如何在 React Native android 应用程序中显示图像? - How to display images in react native android app? react-native图像不适用于android - react-native images not working for android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM