Distribute Archive shows Mac OS instead of iOS - ios

I created a brand new project in the latest version of Xcode and have been building and running it fine in both Simulator and on Devices plugged into my Mac.
Recently I needed to archive & export an .ipa for someone else to install (still using my developer profile and one of my developer devices), but was unable to do so because when I click on the "Distribute" button on the "Archive" tab of the Organizer window, the top choice is "Submit to Mac App store" instead of the iOS store.
Nothing in my project settings indicates Mac OS instead of iOS, so I'm baffled as to why this is happening. I've tried duplicating the Target/Product, but the results are the same. I've also had someone else build the project on a different Mac and they experience the same problem.
Is this a known bug in Xcode and is there some way to get past it?
Thanks,
BT

Check if you have accidentally made your Info.plist part of your target. It shouldn't be. Uncheck it in the Target Membership pane or remove it from the Copy Bundle Resources build phase.
(Found answer via this question: My iPhone app is being archived as "Mac App Archive" and not "iOS app archive".)

Related

Xamarin Deploying iOS App Ad Hoc Failing to Install

I am trying to deploy an iOS app Ad Hoc to an iPhone for beta testing. I've been developing the app on Windows VS, I have a Macbook air with all the necessary software (Xcode, VS, etc), and I have paired to it with VS on my Windows machine. I have also followed the following steps:
Created an Apple Developer account
Created an App ID with the bundle identifier as the same exact one as the one in info.plist
Created a signing certificate using my Macbook Air, downloaded it, and installed it into XCode
Created a provisioning profile with the App ID and the certificate, and made sure to include the device that I want to load the app onto.
Made sure everything above was set to "distribution" and "ad hoc" as needed.
Set Bundle Signing in my iOS project properties to Manual Provisioning, and selected the Signing Identity and Provisioning Profile to the ones that I created for this deployment.
Set the build to Release and the target to Remote Device
Ensured that the deployment target in info.plist was set to the highest available, which is 15.4, though my iPhone is at 15.6 (could this be the problem?)
Set the IPA Packaging Options to "Build iTunes Package Archive (IPA)"
Set "Include iTunesArtwork images and the iTunesMetadata.plist" to true in the same area
Successfully built the iOS project and produced a .ipa file
After all that, I've been trying to get the .ipa onto my phone, which is definitely the device I added to the provisioning profile.
I've tried two methods to do this, and both have failed:
Connecting my phone to my Windows machine and opening iTunes. Dragging the .ipa file onto the device. The app shows up on my phone, but when I try to open it, I get this error:
"This app could not be installed because its integrity could not be verified". Though it should have been.. The device is linked to the provisioning profile that was used to create the darn thing.
Connected my phone to my Macbook Air and accessed the device through XCode > Window > Devices and Simulators. I emailed myself the .ipa file and downloaded it onto the machine (the Microsoft docs explicitly state that emailing the .ipa should work just fine). In the "Intalled apps" section of the device, I clicked the little '+' and then pointed it to the downloaded .ipa. After a few seconds, it pops up an alert window that says "Unable to install *.iOS".
Other things I have tried since this has been a problem:
Recreating the above steps by re-registering my device, creating new certificates, downloading, installing, all that business.
Messing with the deployment target version.
Jumping out from behind the couch and startling it to make it do what it's supposed to.
I swear I'm done with Xamarin forever after this problem is solved, but all the headaches I've experienced have made me think twice about whether to even bother with .NET Maui haha thanks for any help you can provide
Firstly, the error This app could not be installed because its integrity could not be verified" may be caused by the proper certificate or the test devices are not visible in 'Devices' (UDIDs added) in developer.apple.com/account.I found two simialr issues, you can refer to them: link1, link2.
Secondly, have you follow this docs on how to generate the IPA file?

iOS Ad-hoc Distribution with Google MLKit cocoapods

I have a problem with using Google MLKit framework inside my iOS app. I use Ad-hoc OTA distribution to test the app on selected tester devices. It worked great until I added Google MLKit through cocoapods and I'm not really sure what is the reason. Everything compiles properly, Archive is generated without errors but when testers want to download the app it crashes during the "Installing" stage and shows "Unable to install..." alert.
Few things that I tried already :
changing pods Embed type from "Embed and sign" to "Embed without signing"
changing signing from "Apple Developer" to "Apple Distribution" in pods Build Settings for Release scheme
enabling and disabling Bitcode in MLKit pods
The weird thing is that it downloads properly from Ad-hoc OTA on the device that I use to test it directly from Xcode (but I delete the app before downloading it from the server) but doesn't work on any other device.
To find the specific error details:
Theres a mac app called "console" from apple, can't remember if its installed by default or not. Get one of the devices it doesn't work on, connect it to your mac with console open. Try to do the install and the detailed error should show up inside console. If its working on your device and not someone else's, its some kind of signing issue, like you have a cert installed on your phone that others don't.
Fixing the provisioning issue:
Go to your project, select the main target under the general tab. Scroll down to "frameworks, Libraries, and Embedded Content". Make sure the cocoapods library called "Pods_|project-name|.framework" is set to "Do Not Embed"

Uploading expo application version to app store

I have been uploading versions of my app for a while, and suddenly, after an update of mac os, I cannot upload my app anymore, I've upgraded my mac os version, xcode and still nothing....
UPDATE
Its important to note that this is a react native application that i am generating using expo by running expo build ios
these are the errors that i am getting...
ERROR ITMS-90163: "Invalid Code Signing Entitlements. The entitlements
in your app bundle signature do not match the ones that are contained
in the provisioning profile. The bundle contains a key that is not
included in the provisioning profile:
'com.apple.developer.icloud-services' in
'Payload/ExpoKitApp.app/ExpoKitApp'."
WARNING ITMS-90725: "SDK Version Issue. This app was built with the
iOS 11.4 SDK. Starting March 2019, all iOS apps submitted to the App
Store must be built with the iOS 12.1 SDK or later, included in Xcode
10.1 or later."
Does anyone have an idea?
The first part, ITMS-90163, is an error -- basically stating that your app is trying to use iCloud but the provisioning profile (that you set up at developer.apple.com) doesn't have iCloud enabled. This is what's blocking your upload.
Since you say this just started happening, probably this means the iCloud switch in Xcode got flipped on accidentally (if your app is not a actually using iCloud).
In Xcode 10.1, be sure your project is selected in the upper left and your target is selected, then click on the Capabilities tab and scroll down until you see iCloud, and click it OFF. Important: This is only a reasonable choice if your app does not use iCloud.
If your app does use iCloud, you instead need to generate a new provisioning profile. You can do this manually by going to developer.apple.com, and click on Account in the upper right. Click "Certificates, IDs, & Profiles", and follow Apple's instructions. However, you can have Xcode managing provisioning profiles for you automatically, by clicking on the General tab and then checking the box "Automatically Manage Signing".
The second part, ITMS-90725, is just a warning, so it's not blocking you from uploading (though it will be a problem in March). To resolve this, first, be sure you are on Xcode 10.1 or later. (While in Xcode, go up to the menu bar and click Xcode -> About Xcode to check.). It's possible that you could be using Xcode 10.1 and still not using the latest SDK for some reason. Under Build Settings, check Base SDK. It should just say "iOS".

Unable to update existing app store app [duplicate]

Previously with Xcode 7.3.1 I was able to build directly over my app store app on my iPad and test the upgrade scenario, which worked perfectly fine. This week I upgraded to Xcode 8 and when I try the exact same approach, I keep getting this upgrade error
"This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed."
I tried multiple solutions posted on this thread and none of them worked. I also don't have a watch app. Just a simple iOS app target.
App installation failed due to application-identifier entitlement
I deleted my certs and provisioning profiles and recreated them and still the same problem. I then went and downloaded Xcode 7.3.1 and tried it again with the exact same problem.
Now I am stuck without being able to fully test my upgrade scenario.
PLEASE HELP !!
I had the same issue while trying to upgrade application.
And here what I've found:
I checked application-identifier entitlements of old app and new app. You can do that by running codesign -d --entitlements :- path/to/AppName.app/AppName or open file "archived-expanded-entitlements.xcent" at path "AppName.app/AppName".
Application-identifier of old app was "1234XXX5X6.com.mycompany.myapp" but in new app it was "1234XXX5X6.com.mycompany.myapp.develop".
Usually I set "Bundle Identifier" directly in Info.plist.
But I didn't know that there is also a "Product Bundle Identifier" property in project Build Settings.
The previous version of app was built with Xcode 7.3.1 and it had following settings:
Info.plist: com.mycompany.myapp
Build Settings: com.mycompany.myapp.develop
application-identifier: 1234XXX5X6.com.mycompany.myapp
The new version was built with Xcode 8.2.1 and it had following settings:
Info.plist: com.mycompany.myapp
Build Settings: com.mycompany.myapp.develop
application-identifier: 1234XXX5X6.com.mycompany.myapp.develop
Seems like new Xcode have different source for application-identifier.
So I just corrected "Product Bundle Identifier" and my problem was solved.
Remove the existing application from the device and Run again.
To fix this just enable "Automatic manage signing" from general tab of project settings.
I had also problem for running app on my device directly from xcode 8. Deleting and generation profile and certificate did not worked for me. But enabling "Automatic manage signing" worked for me.
Hope this helps!
Check this question of mine:
Xcode 8 shows error that provisioning profile doesn't include signing certificate
Here is one solution if you want to upgrade over your existing App Store app without deleting it but your application-identifier entitlement does not match. Upload an archive of your new build to the App Store and then use TestFlight to download it to your device. This is not as quick as building to the device, but it will overwrite your old app with your new build while keeping your old data in place. For (relatively) quicker turn-around testing of your upgrade process once you have a new build available on TestFlight:
Delete your app off of your device (assuming it was a recent build)
Download your app store build and generate some data
Download your TestFlight build, but don't run it
Build your newest build directly to the device
The TestFlight build overwrites the entitlement without deleting the old data, so Xcode happily will install your new build over the TestFlight build, but you are still testing your upgrade process as if you were building directly on top of the App Store version of your app.
I got this from an .ipa generated as a Jenkins artefact. The problem for me was that Jenkins was using a different provisioning profile.
I manually set Jenkins to use the same profile as the updated version that I was trying to install, and it started working.
Select the App Target and click on General, if you select or ticked checkbox automatically manage signing.
Untick this automatically manage signing and select appropriate signing provisioning profile and #Build and run again.
See the below photo.
Solved!! Short answer - delete old app from your iPhone
I went to my iPhone storage and used the search bar to find the offending app(because it wasn’t showing on the app list) and found an old version hidden, deleted it and now it works.
What worked for me was to go (within Xcode) to Window > Devices and Simulators, then select my iOS device and delete the app there. This is detailed in this Medium article.

When Xcode adds the "iCloud" entitlement to my App ID for my iOS project, it invalidates the entitlement for Mac

I have a Mac project and an iOS project that both use iCloud capabilities. When I created the Mac app there was a red "!" next to Add the "iCloud" entitlement to your App iD, in the iCloud section of the Capababilities tab. When I click "Fix Issue", the red "!" appeared in the corresponding window of the iOS project.
Now whenever I build one app, it undoes whatever "Fix Issue" fixed on the other.
I found the same question here on SO but the only suggestion was to manually add a "Provision Profile" under "Build Settings / Code Signing" section in Xcode 5 for the iOS and OS X project. I experimented with a number of different things but I don't know how to create a Provisioning Profile that will work for both the Mac and iOS builds. The choices in the iOS project are iOS Team Provisioning Profile: *, and None. Likewise in the Mac project it's Mac Team Provisioning Profile: *, and None.
In the Apple Member Center. It seems I can add a profile for Mac or iOS, but not one profile for both.
How can I get Xcode to allow me to compile each application (Mac and iOS) without having to Fix Issue each time I alternate between them?
Thanks.
I know this is absurd but here's what I did before the issue "fixed itself".
I exported my account using Xcode preferences. I disabled my Mac in the Apple dev Member Center. I revoked my most recent Mac Development Certificate in member center - there were two that differed only by expiration date. I changed my Team in the Mac project to None. I got Xcode to cough up the Xcode quit unexpectedly Problem report even though it didn't quit at all. This is reproducible by by trying to "Run" the app with team set to None. I punched "Fix Issue" a couple few times. I set the Team back to where it was originally, imported the accounts I had previously exported.
Voila. No more flip-flopping of the iOS/Mac entitlement issue.

Resources