thekevinbrown/react-native-schemes-manager

Archiving a config named something other than 'Release' e.g. 'Release-Staging'

Closed this issue · 7 comments

Is it possible to archive a config other than Release? I've been stuck for days now trying to do this. I can run and build any config fine, and I can archive Release, but can't archive anything else. I get this error: facebook/react-native#11813

I tried all the troubleshooting steps of this package, plus all of the suggestions in that thread but they don't seem to work. Then in this comment it says 'We were not able to build an archive from a different build config. Run is no problem. Since we use BuddyBuild and only require our release version to be build for archive (to be able to upload to itunes), this did not bother us.'

So I was wondering, is it actually impossible? And if it isn't, can it be added in?

Unfortunately the answer at this stage is, "I don't know". In general the bundler skips making a JS bundle for things that look like "Debug" to it. We might be able to make the script smart enough to force it to push one through, but I don't have an active RN project to play with at the moment, so I'm just not sure how the latest bundler handles this situation.

From an XCode perspective it's definitely possible, as XCode doesn't care what the schemes are, it's just that the debug build is much quicker because it doesn't have to make a bundle and it hot loads it from your dev machine. That doesn't work well for distribution though.

@thekevinbrown Thanks for your response. I think maybe my original question wasn't clear. I'm not trying to archive the Debug config or anything that looks like it, I'm trying to archive a config that looks like Release, but isn't actually named Release e.g. 'Release-Staging'. I would have thought this was possible, but I can't get it to work, so was wondering if it actually is possible to do.

Gotcha. In that case it's still the same answer. It should work based on my understanding of how XCode interacts with React Native and the packager, but I still don't have a project to play with personally.

I just successfully archived a non-"Release" build, uploaded it to iTunes Connect, and am now using via TestFlight. I can't say I did anything specifically to make it work other than make sure the config was set up with each dependency—I was getting an error at first because this hadn't happened for one package. I ran the command npm run postinstall to make sure of this.

That's great. In that case I'll go ahead and close this issue, sounds like it would be a good idea to document the error in the readme and recommend a fix if you can figure out what it was at any point. I'd be happy to accept a PR for that.

There's no real fix. Just making sure the configuration gets set up with each dependency via postinstall, as one is supposed to do. So I think with proper use this is default behavior. I think for some reason I had the impression that postinstall was supposed to automatically run after installing new dependencies. As long as you make sure to run postinstall after installing a new dependency it'll be fine. Not sure this is worth a PR as it's kinda expected

I think I just need to go back and do some more playing around, and get it to work. It's good to know that it's possible. I think this can be closed, and I don't think it is worth a PR.