Closed bill-dai closed 4 years ago
hey, thanks for kind feedback :)
regarding you problem: could you please share more information?
what exactly is your setup? do you use CLI to switch environments or did bind env to schemes? what does "tries to upgrade the previous install" exactly? does that mean it overwrites app in previous environment? do you keep xcode open when executing command (in case if switching with command line)?
Hi @maxkomarychev, I used CLI to switch environment before I build the app in Xcode. After running the npm run runc .env.qa, I do see bundle IDs and display names are being changed correctly in the general tab.
Yes, Xcode is trying to overwrite the app in the previous environment. It would not install a new app. Eg. If I switch from prod to qa, it will try to overwrite the prod app but with the error I mentioned. And the same if I switch from prod to qa.
Yes, I kept Xcode open when switching. Let me try running the config with xcode closed.
Just tried running the config with xcode closed. Still getting the same error in Xcode.
"This application’s application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed."
any chance you can share screenshot of your entitlements file with masked data?
btw, maybe this helps https://developer.apple.com/library/archive/qa/qa1710/_index.html ?
xcode does not play well if xconfig is regenerated on the fly so its best to reopen it when switching environments
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
Does this look correct to you?
<key>aps-environment</key>
<string>development</string>
this is related to push notifications, looks good to me
Running the CLI I didn't receive the error, but the app is upgraded from prod to qa instead of installing a separate app.
are you running app with CLI on the device or simulator?
have you enabled push capabilities for both qa and prod apps?
All in all if the application name and bundle identifiers look updated in ui in General tab then library works, I suspect there might be an issue elsewhere.
Are both your apps registered under the same developer's account?
At this point I can only ask for more information (like share pieces of infoplist, more screenshots etc) or reproducible demo project.
The issue is now gone. I revoked the QA identifier, and created a new identifier and provisioning profile in my Apple dev account. And now XCode builds QA and Prod as separate apps now. I suspect it has to do with the automatic signing. The old QA identifier had exactly the same setup, but it didn't recognize it as a different identifier.
Indeed there's nothing wrong with RNUC, but Xcode settings and configuration issues.
Thanks for your help and patience @maxkomarychev !
I must say RNUC is the easiest and neatest env config for React Native as right now. Thank you @maxkomarychev for this great package!
Everything works like a charm for me after closely following the instructions except XCode wouldn't treat my qa and prod env configs as different apps even though they have different bundle identifiers and display name. Whenever I switch the env, Xcode always tries to upgrade the previous install on the device and then with the failed installation error message: profile doesn't match the entitlements file's value for the application-identifier entitlement.