1

I've checked this question and nothing helps.

So, I have such structure:

  • src
    • components
      • (my components, buttons e.g.)
        • images
          • ...
        • component.tsx

where every component has its own folder with images.

Command for building iOS:

node node_modules/react-native/local-cli/cli.js bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'

I'm also using rnpm with such config:

"rnpm": {
  "assets": [
    "assets/images"
  ]
}

The problem is simple - production build of my iOS application doesn't have images at all. But TouchableOpacity on them works correctly.

Android production build works fine, everything is OK.

So, how can we build iOS application with images?

Yurii N.
  • 5,455
  • 12
  • 42
  • 66
  • Why do you specifie in your rnpm config that your assets are in `assets/images`, while your assets are in `src/components/{component}/images`? – Antoine Grandchamp Nov 26 '18 at 15:52
  • @AntoineGrandchamp Good question, I have also `assets/images` folders in root, but images from that folder are also blank. – Yurii N. Nov 26 '18 at 16:03
  • Can you show how you import your images ? – Antoine Grandchamp Nov 26 '18 at 16:40
  • @AntoineGrandchamp Sure, `` something like that. And I also edited the question, to show how `images` folder and component are correlating. – Yurii N. Nov 26 '18 at 16:58
  • Same for me. I have bundled everything properly and done everything right in Xcode yet now success. – JeremyF Mar 22 '19 at 01:56
  • 1
    @JeremyF, for me, problem disappeared when stopped using [fastlane](https://fastlane.tools), but that's really not an answer. – Yurii N. Mar 22 '19 at 20:45
  • @YuriiN. Just solved it. I changed my bundle command assets-dest to ./ instead of ./ios or ./assets and that did the trick. – JeremyF Mar 22 '19 at 23:17
  • @JeremyF yep, I did it too, unfortunately that doesn't solve the problem for me. So, it depends. – Yurii N. Mar 23 '19 at 17:05

0 Answers0