我使用以下命令构建main.jsbundle
react-native bundle --entry-file =' index.js' --bundle输出=' ./ IOS / billhunters / main.jsbundle' --dev = false --platform =' ios' --assets-DEST =' ./ IOS'
看起来资产包含在捆绑包中
但是当我在发布模式下在设备上运行应用程序时,图像不存在。
我在官方文档推荐的方式中在我的JSX中添加了图像元素:
<Image source={require('./assets/img/logo.png')} />
有没有人遇到过这样的问题?当应用程序在调试模式下运行时,一切都很好。
答案 0 :(得分:1)
在下面的文章中找到答案: https://medium.com/the-react-native-log/first-time-deploying-with-react-native-f524eb3e705d
答案 1 :(得分:0)
尝试将--assets-dest='./ios/billhunters'
更改为undefined
。