React Native iOS不显示本地图像 [英] React Native ios not showing local image

查看:773
本文介绍了React Native iOS不显示本地图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • macOS : 10.14.6
  • Xcode : 11.0
  • react : 16.8.6
  • react-native : 0.60.5
  • project folder structure : google drive image link

我做了一个简单的应用程序。我在Android / iOS模拟器和真实设备上对其进行了测试。
一切正常。现在,我正在尝试在App Store上进行部署。

I made a simple app. I tested it on Android/iOS simulator and real device. It worked well all. Now I'm trying to deploy on App Store.

我将Xcode的构建方案从调试以发布(产品->方案->编辑方案->运行->构建配置)。
然后我在模拟器上运行它。结果是此(Google驱动器图像链接)

I changed the build scheme on Xcode from debug to release ( product -> scheme -> edit scheme -> run -> build configuration ). And I run it on simulator. And result was this(google drive image link).

我不知道为什么我的应用程序无法加载静态图像。
如果我更改了方案以进行调试,它会像此(Google驱动器图像链接)一样显示

I don't know why my app cannot load static image. If I changed the scheme to debug it shows well like this(google drive image link).


  1. 我知道了这个错误 / Users / mac88 / Desktop / Projects /팀포크봇/VoiceCarRN/ios/main.jsbundle:删除ios文件夹中的main.jsbundle文件后,没有这样的文件或目录

  2. 2019-10-13 02:09:06.046867 + 0900 VoiceCarRN [44601:3301900] [PERF ASSETS]正在加载尺寸为{854,1334}的图像,大于屏幕尺寸{750,1334}

  1. I got this error /Users/mac88/Desktop/Projects/팀포크봇/VoiceCarRN/ios/main.jsbundle: No such file or directory after I remove main.jsbundle file in ios folder.
  2. 2019-10-13 02:09:06.046867+0900 VoiceCarRN[44601:3301900] [PERF ASSETS] Loading image at size {854, 1334}, which is larger than the screen size {750, 1334}

请检查!!

推荐答案

使用此命令创建jsbundle和Assets文件夹后

After you create the jsbundle and assets folder using this command

react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios / main.jsbundle --assets-dest ios

您必须将它们都包含在 Copy Bun中在$code>构建阶段中,闲置资源步骤,因为您正在发布配置中运行该应用程序。

you will have to include both of them in Copy Bundle Resources step in Build Phases, since you are running the app in release configuration.

这篇关于React Native iOS不显示本地图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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