2

Environment

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

Background

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.

Problem

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).

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).

Maybe...?

  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}

Check please !

5 Answers 5

3

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

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your help, Is this process required everytime I make a react-native app for ios ? Or did I something wrong in react-native configuration ?
This is required every time you build your app in release configuration, from xCode.
I ran this command in vs code: npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios then cd ios > pod install Problem Resolved.
2

use this commmad in inside project to copy assert from app to ios folder

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

please install react-native cli for running above command.

for this warning

Loading image at size {854, 1334}, which is larger than the screen size {750, 1334}

just add resizeMode: 'contain' in image style

Comments

1

The real cause was index .tsx file.

I'm using typescript, and I used index.tsx.

I changed index.tsx to index .js and the image shows up correctly !

1 Comment

Thanks so much~ I've spent ages and tried numerous way getting this work
1

add/modify this command in your package.json file

“build:ios”: “react-native bundle --entry-file=‘index.js’ --bundle-output=‘./ios/main.jsbundle’ --assets-dest ./ios/release --dev=false --platform=‘ios’”

Comments

0

I think it is an issue of your xcode version. So try to update xcode 11.7 and don't use Beta version to build React Native. I have same issue with you because I use Xcode 12 https://developer.apple.com/forums/thread/652406

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.