React-Native Offline Bundle - Images not showing

前端 未结 3 794
感情败类
感情败类 2020-12-29 07:10

I have a React-Native app I\'m trying to deploy in Release mode to my phone. I can bundle the app to the phone. Database, Video and audio assets are all in there but no imag

3条回答
  •  孤城傲影
    2020-12-29 07:40

    When you are generating bundle , Also put --assets-dest ./

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

    It will generate main.jsbundle and Assets folder . Go to your Xcode right click add files to project and add main.jsbundle file to project. Also drag and drop Assets folder and select create by reference (note: do not select create group).

    i was using react 0.33, main.jsbundle is using assets(small a) folder but generating Assets(Caps A). I just changed the generated folder from Assets to assets and import it to xcode and it start working

提交回复
热议问题