1

What to achieve.
Build a react native app for ios release to be able to submit to TestFlight

What i've done.

  1. Read the documentation
  2. Change the scheme to build for release(production)
  3. Ran Product > Archive.
  4. Fails with: Missing module if switch to build for production
'React/RCTBridgeModule.h' file not found

Other things to know. This project is using Cocoapods and this is the pod file

target 'surfpass_app_rx' do

    pod 'React', :path => '../node_modules/react-native'
    pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
    pod 'react-native-webview', :path => '../node_modules/react-native-webview'
    pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

    pod 'Firebase/Core', '5.15.0'
    pod 'Fabric', '1.9.0'
    pod 'Crashlytics', '3.12.0'
    pod 'Firebase/RemoteConfig', '5.15.0'
    pod 'Firebase/Messaging', '5.15.0'
    pod 'GoogleSignIn', '4.4.0'

    target 'surfpass_app_rxTests' do
        inherit! :search_paths
        # Pods for testing
    end
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "React"
            target.remove_from_project
        end
    end
end

The thing here is the app builds ok for debug, but not for release. I had other targets but now I just have one single target and still fails.

AXSM
  • 1,142
  • 1
  • 12
  • 27
  • If you really think a question deserves a downvote, please elaborate on your reasons so that the question may be improved. – HenryRootTwo Nov 09 '19 at 23:45

1 Answers1

0

To setup multi targets for iOS app, it's easy. Please refer to below screenshot in xcode.enter image description here expand the TARGETS, select one target then right click to duplicate. Then you get another similar target.

To solve your question, i think you likely need to solve the issue in pass_app_rx_pro target first, instead of setting up more targets. To solve please refer to React/RCTBridgeModule.h file not found

chancyWu
  • 14,073
  • 11
  • 62
  • 81
  • I did what you @chancywu suggest, but the problems comes when I configure the production scheme/target for release. In debug everything works, but not release. I got this errors for release . 'React/RCTInvalidating.h' file not found 'React/RCTLog.h' file not found – AXSM Jul 23 '19 at 18:38
  • @AXSM you are asking how to setup multiple targets, regarding your error message about React/RCTBridgeModule.h file not found, you can refer to exactly the link. For other files not found, you need also check one by one... maybe you can setup different questions for answer. – chancyWu Jul 24 '19 at 01:53
  • I sorry for the confusion, I delete the other target, and make sure the default target is working properly. Doesn't matter if only use the default target, it will fail if I change the scheme to build for release. I'll edit my question. – AXSM Jul 24 '19 at 17:37