Lately I’ve been pretty busy with work that I haven’t had much time to write my own code. Having made some time, I decided this weekend would be a perfect time to update my Math Ref app. As an added bonus, I was going to setup my new iPad Pro for development. This was the start to losing almost an entire day to provisioning profiles and what I found out was an Xcode 7.3 bug.
The problem started when I connected my new iPad to test a bug from a user about restoring purchases. When I went to run the build I got the typical Xcode thing of something didn’t code sign properly, but you can let Xcode “Fix Issue”. Fix issue has rarely worked for me. I find it funny that there a few git repositories that try to fix the “Fix Issue” prompt. Step one to resolve this issue was to make sure that my device was added to my developer account. Things looked good there so it was back to Xcode. Looking at the code sign process, it appeared that the actual failure happened when trying to add the IAP entitlement to the build. The confusing part to me is that it said that com.happymaau.XXX was already in use and I needed to choose a new string for my App ID. It was in use, by me!
After some research, I went all nuclear on my provisioning profiles. I deleted all of them from my machine via Xcode (Preferences->Accounts->View Details) and also from Keychain Access. After that I signed into my developer account and deleted any profile that was no in an active state. Reopened Xcode, same problem. Rinse, but before repeat, I nuked all the profiles in my developer account.
Starting from scratch. So new certificates and profiles were made, account re-added to Xcode, and all profiles redownloaded. This time for sure right. Nope, same error. Back to researching.
Turns out this is all from the Xcode bug mentioned above. Having tried everything listed on that link and others, I decided to downgrade to Xcode 7.2 and run a build from there. Turns out this worked. Well, the build worked. I was able to re-add the IAP capability to my app, but now I can’t deploy to my iPad as 7.2 only worked up to iOS 9.2, not the 9.3 version on my device. Awesome. So having gave up on fixing this bug during the weekend I redownloaded Xcode 7.3.
A few hours later, after the download completed, I decided to load up the project and trying once again to resolve this issue. I was mildly surprised to see that there were no warnings and my device was a valid target! Build and run worked and I was back in business. Bugs were squashed and I’m back to being able to develop on all my test hardware.
There were times that I thought I was going to lose my mind as you can see from my last few tweets I was possibly not in a good mindset.
So if you’re running into this issue, here’s the tldr;
- Kill your profiles from Xcode
Remove your dev account from Xcode
Delete any expired certificates in Keychain Access
Install Xcode 7.2
Add back your dev account
Redownload your profiles from Xcode
Build your app (Fix Issues will probably be fine here)
Once you have your app building download Xcode 7.3
Reinstall and you should be back in a functional state
Known it’s a lot, and I suggest trying other people’s shorter options listed in some of the links above before you do this. This is just my black magic way to get around this issues.