react-native iOS app not showing static assets (images) after deploying

前端 未结 5 1572
-上瘾入骨i
-上瘾入骨i 2020-12-01 12:58

I have all my static images in a folder called \"images\" in the root of my project. However, after I run the following command to bundle my app, the app works but no image

5条回答
  •  广开言路
    2020-12-01 13:31

    Please check XCode console log first. You will find that the app couldn't find out those specific image assets on path "{project name}.app/assets/resources/.."

    So, you need to put images on those fixed paths, unlike iOS native App. Lets add "assets" folder to your 'Copy Bundle Resources'.

    Step 1: Select XCode project -> Build Phases -> Copy Bundle Resources

    Step 2

    Step 3

    Step 4

提交回复
热议问题