Deploying to IOS store

Anything libgdx related goes here!

Deploying to IOS store

Postby junkhar » Sat Jun 16, 2018 2:05 pm

Information on how to do this is horrible and the process is a nightmare. The process is bizarre and complicated, thanks Apple.
It also requires that you have a Mac and iPhone. Accept it, breathe that in and then move on.

Before you start anything, read these two articles:
http://martiancraft.com/blog/2017/05/de ... ing-part1/
http://martiancraft.com/blog/2017/07/de ... ing-part2/

Other tools here:
https://www.squins.com/knowledge/robovm ... ng-issues/

The above links or purely for Apple, no relation to the issues of doing it from libGDX.
Base articles for that are here:
https://frozenfractal.com/blog/2016/3/1 ... dummies-1/
https://frozenfractal.com/blog/2016/3/1 ... dummies-2/

I spent a couple of days before I read through all of the above. Here is the quick summary of the process. I made a directory and saved all of the keys, certs and related stuff in a single place as you will end up with at least 6 different certificate / key files. You could try to let XCode manage that, but it's not good and based on what I saw it doesn't play well with all the steps of getting an app to the store.

On a mac you will need to request two certificates from their Keychain access program. Those certs will be uploaded to the developer.apple.com website to create a developer signing key and an ad-hoc signing key. These keys will be downloaded to your mac and double clicking on them will load them into the Keychain program. This is the first step of setting up the signing. Both of these keys can be safely added to the Keychain once downloaded.

If you don't have the signing, you can't even get the app to run on a phone.

With the two keys got ahead and get the two provisioning profiles (PP) from the website used to get the keys. You will need a developer and distribution profile as well that are tied to the keys you just created. Download them to your mac, but only double click the Dev provisioning profile for now. The reason why will be evident later. Double clicking on the DEV-PP will add the following file: ~/Library/MobileDevice/Provisioning Profiles/abcdef-0123-5678-abcdef123123123.mobileprovision

The abcdef-0123-5678-abcdef123123123 portion can be copied into the ios/build.gradle in the robovm portion:
Code: Select all
robovm {
     archs = "thumbv7:arm64"

     // Dev provisioning
     iosProvisioningProfile = "abcdef-0123-5678-abcdef123123123"   
}


When creating the robovm run config to load the build onto the phone, make sure you select the correct arch for the build and use the developer signing key as part of that.
With this done, you should be able to load to your phone from Android Studio. If you can run on your phone, you're off to a good start, but the hard part is coming up if any of the previous steps weren't done exactly right. If you did, you'll be fine.

Note: I did have to delete the <component name=FacetManager" </componant> section out of my ios.iml to avoid robovm from being null at compile time. I did this frequently as anytime I had to re-sync the gradle, it came back.

When it's ready for hitting the store, add the Distribution PP to the gradle file and comment out the Dev PP. Then go to build IPA and make sure you select the Dist signing key and the DIST PP when building the IPA.

Once the IPA is done, I open XCode just for the purpose of launching the Application Loader as it didn't seem to work when launched on its own. If everything is in order, the app will be in the store.
junkhar
 
Posts: 19
Joined: Mon May 08, 2017 9:25 pm

Re: Deploying to IOS store

Postby junkhar » Mon Jun 18, 2018 4:13 pm

I did all of the above and it worked for exactly two pushes to the App Store. Then it broke and I've been unable to figure out why. I can't tell if it's a problem with an intermediate certificate that XCode usually manages or not. I have no problem getting the app to play on the connected and registered iPhone. It compiles and starts up without problem every time.

Here are some things I have tried:
Code: Select all
$->fastlane sigh repair

result is that all profiles are correct


With an XCode project open with and without automatic profiling. Same signature fail.

With and without hardcoded signing and provisioning profiles. Same signature fail.

Code: Select all
rm -fr ~/.robovm
Makes compile take forever, but same result.


Have also tried a myriad of combinations. The one thing I am uncertain about is the intermediate profile and how XCode uses that to sign the app AFTER it plays on the phone. I found this
https://medium.com/ios-os-x-development ... b247760bef
, but it isn't clear how those interactions tie together.

If anyone has ideas, I'd greatly appreciate them.
junkhar
 
Posts: 19
Joined: Mon May 08, 2017 9:25 pm

Re: Deploying to IOS store

Postby junkhar » Mon Jun 18, 2018 4:35 pm

Here is the error:

ERROR ITMS-90035: "Invalid Signature. A sealed resource is missing or invalid. The file at path [MyGame.app/MyGame] is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library/ios ... ction.html"
junkhar
 
Posts: 19
Joined: Mon May 08, 2017 9:25 pm

Re: Deploying to IOS store

Postby evilentity » Mon Jun 18, 2018 6:43 pm

When in doubt, nuke everything and start from scratch. Probably something changed, like you added new entitlement and you need new keys and stuff.
Looking for a freelancer? PM me!
Check out libgdx discord server!
evilentity
 
Posts: 4867
Joined: Wed Aug 24, 2011 11:37 am

Re: Deploying to IOS store

Postby junkhar » Mon Jun 18, 2018 9:08 pm

So instead of nuking it, which I have to admit the use of nukes crossed my mind a few times, instead I spent some time isolating the problem. I got it to sign again and the app is now approved, which means I can finally test the last item for release.

Here are some observations though. When it finally signed again, I removed the following so they were clean.

Code: Select all
All provisioning profiles removed, then clicked again using the SAME ones I had been using. - note: I had two, one dev, one dist. XCode was in manual mode and open, but it generated a third PP that auto-created, even if deleted as long as XCode was open. It signed with that PP present. I haven't been able to determine it's purpose.

.robovm, but not the whole thing. Only the ios packages for each of the archs. That makes almost no difference in compile time. So I highly recommend this.

Finally I have an ipa directory where the IPA goes. On the successful IPA build, I had removed the both files in the directory prior to the build. This may have been the key item, but not sure.


So the conditions where it signed were:
No hard-coded signing or PP, I just selected the DIST sign and PP from the build window.
XCode open with manual signing and the same PP selected there.

So it would appear that something in either the ios/ directories or the previous IPA file or partner file is what causes this to go haywire. Hope this helps. I will add any further information I learn here as this issue is overly complicated for no valid reason.
junkhar
 
Posts: 19
Joined: Mon May 08, 2017 9:25 pm

Re: Deploying to IOS store

Postby lowandre » Sun Dec 29, 2019 5:27 am

I was having this issue after creating a new provisioning profile for my app. The key for me was to delete the previous IPA build files first as you did, then build the new IPA
lowandre
 
Posts: 1
Joined: Sun Dec 29, 2019 5:21 am

Re: Deploying to IOS store

Postby tintinger108 » Sun Dec 29, 2019 10:38 am

Also, create the IPA always in a fresh directory. I do not know why, but reusing an old output folder produces signing errors in my case.
tintinger108
 
Posts: 18
Joined: Fri Sep 13, 2019 3:44 pm

Re: Deploying to IOS store

Postby imagnity » Tue Jan 07, 2020 5:59 am

junkhar wrote:Here is the error:

ERROR ITMS-90035: "Invalid Signature. A sealed resource is missing or invalid. The file at path [MyGame.app/MyGame] is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library/ios ... ction.html"


It's not as complex you think. Most online "how to" guides are not up to date and hence, it makes things complex. The process is rather simpler compared to a decade ago. :) For the problem above, go to ~/Library/MobileDevice/Provisioning Profiles and delete all profiles there. Don't worry you can re-download them. Now go to apple developer account, the go to certificates, identifiers, and profiles, and then download all ceritificates and profiles for backup. Then remove all ceritificates and profiles. Go to Xcode, create a Distribution Certificate. Go back to apple developer portal and create a Distribution Profile using the distribution certificate. Go to XCode and download manually. Close xcode. Go to android studio, and do to Build IPA. Choose both distribution account and profile. All should be good!
Check out my games - http://www.imagnity.com/games/
imagnity
 
Posts: 197
Joined: Mon Mar 25, 2013 6:27 pm


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot] and 1 guest