简体   繁体   中英

React Native iOS App, crash on Release Mode

Hi I am facing an issue when I am releasing my app, I am using the react-native 0.39 , but I have a problem, the app works perfect when I run it as debug mode using react-native run-ios and when I run it from xCode, but when I run as release mode using react-native run-ios --configuration Release the app crash imediatly after show it, but here the problem when I run the app in release mode in xCode the app works again perfect, even all my testflight user have the same issue, i have followed the correct steps in order to deploy:

  1. Generate the local bundle

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

  2. Change the url in AppDelegate

    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

  3. Copy the bundle and the assets to my project

这是我项目中的结构

Any idea why I am getting this issue ? the information about my environment is the bellow

  • xCode 8.2.1
  • MacOS Sierra
  • BaseiOS 8(I have tried change to each version available in my xCode 8,9,10)

Regards

I have some suggestions maybe they can help you:

  1. Clean the build through Xcode
  2. Click on the project in Xcode and you can see two targets. Normally YOUR_APP and YOUR_APPTests. Check YOUR_APPTests Build phases -> LinkBinary with Libraries. You will need to add libReact.a and libART.a
  3. Try to run 'release' mode in xcode directly and test with simulator see if it crashes. You can setup this in 'Product -> Scheme -> Edit scheme -> Run'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM