skip to Main Content

If my React Native XCode project’s run scheme is configured with the "Debug" build configuration, it works fine.

With the "Release" configuration, it cannot connect to the bundler (I get the "Invariant Violation" which talks about Metro not being found).

I need to test the release build as the app is crashing in TestFlight.

Is it possible to test an iOS release build on a USB connected device?

2

Answers


  1. Chosen as BEST ANSWER

    It came down to a mistake in my build configuration, which I'll post here on the off chance someone finds it useful.

    In the main app target's "Build Phases", in the "Bundle React Native code and images" phase I had the line:

    export ENTRY_FILE=index.share.js
    

    Which was supposed to be in an extension's configuration, not the main app.

    It was the reason not only for the release tests not working, but also the TestFlight crash.


  2. It is. Yeah, that’s weird. I’m sure you’ve scoped the docs, but if it were me, I would:

    • Quit all currently running Metro instances.
    • Run npm start from the directory of your react native project.
    • Then try running your app with the Build Configuration set to release.

    If it’s still not working, a few other things I’d try:

    • Running npm start --reset-cache
    • Create a new empty react native app and try running it with a release build config. Just to rule out anything project specific.

    If none of that helps, let me know where you are and I’ll see if anything else comes to mind.

    Best of luck

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search