How to fix fastlane [Xcodeproj] Unknown object version (56). error? - ios

I'm trying to build & archive iOS app using fastlane. But it always fails with this error:
[09:49:04]: Couldn't automatically detect the provisioning profile mapping
[09:49:04]: Since Xcode 9 you need to provide an explicit mapping of what
[09:49:04]: provisioning profile to use for each target of your app
[09:49:04]: [Xcodeproj] Unknown object version (56).
This is my lane:
clear_derived_data
unlock_keychain(password: keychain_password)
gym(scheme: "Staging")
Also tired this instead of a simple gym():
build_ios_app(scheme: "Staging",
clean: true,
xcargs: "-allowProvisioningUpdates")
Tired to specifically set provisioning profile mapping, but got this contradicting error message...
[09:26:39]: Couldn't automatically detect the provisioning profile mapping
[09:26:39]: Since Xcode 9 you need to provide an explicit mapping of what
[09:26:39]: provisioning profile to use for each target of your app
[09:26:39]: [Xcodeproj] Unknown object version (56).
[09:26:39]: Detected provisioning profile mapping: {:"*.staging"=>"Jenkins", :"*.dev"=>"Jenkins"}
NOTE: The project doesn't use any cocoapods, only SPM.
Xcode version: 14.2

This could honestly be several different issues, but most likely you will need to manually set the correct provisioning profiles in Xcode like this (automatically manage signing is turned off):
I'm assuming you are using Fastlane match for signing. Also make sure to do this for each target (i.e. any Share Extensions, Today Widgets, etc.)

Related

No matching Provisioning profiles allowing aps (But there is a provisioning profile that should allow it)

I've been working on creating a release for an application (for iOS) I am working on but it seems like the transition between debugging and release is harder than I imagined. In Development, I was able to build successfully but now that I have switched over to a release version, it keeps coming back with 1 error and 2 warnings;
No matching provisioning profiles found: None of the valid provisioning profiles allowed the specified entitlements: aps-environment.
iOS deployment target '11.1' for architecture 'arm64' and variant 'normal' is greater than the maximum value '9.3.99' for the iOS 9.3 SDK.
iOS deployment target '11.1' for architecture 'arm64' and variant 'normal' is greater than the maximum value '9.3.99' for the iOS 9.3 SDK.
I presume this has something to do with the Provising Profiles needing to be in the Production form which you can do so on the developer App Store. I did this already and I am aware that the aps stands for the Apple Push Services. I did so but I seem to get the same error everytime so I either have done something wrong.
I have narrowed down some details that may be helpful but if not I apologies:
The Provising profile and the application have the same bundle identifier and Team assigned to it.
The Provising Profile has Push Notifications enabled.
Xcode Version 7 (Swift 2) <- I may be well aware that this might be the issue, would I really have to convert from 2 to 3 then from 3 to 4 because I feel that would be really time consuming.
Cordova was used to generate the project.
Thank you for your help in advance.
Looks like there could be a couple things going wrong.
iOS deployment target '11.1' for architecture 'arm64' and variant 'normal' is greater than the maximum value '9.3.99' for the iOS 9.3 SDK
This error is usually caused by setting the wrong <preference name="deployment-target" value="***" /> in your config.xml. Depending on the version of cordova-ios you're using would also effect how the Xcode project gets build. Make sure the version of cordova-ios is compatibly with your version of Xcode.
No matching provisioning profiles found: None of the valid provisioning profiles allowed the specified entitlements: aps-environment.
And for this error, it would seem you don't have the entitlement set on your provisioning profile under your developer account. Go to developer.apple.com, log in, and find your app. There should be an edit button where you can change the entitlements. Its probably the one for Push Notifications. This can also be done in new versions of Xcode directly in the Capabilities tab.

Bitrise is trying to code sign an embedded framework with wrong provisioning profile

My iOS project has an embedded framework. I am trying to build it on Bitrise, but it fails because it tries to code sign this framework with the same provisioning profile as the actual project.
This is the error it produces (split onto separate lines for readability):
❌ Code Sign error: Provisioning profile does not match bundle identifier:
The provisioning profile specified in your build settings
(“Profile Name”) has an AppID of “com.example.mainidentity”
which does not match your bundle identifier
“com.example.frameworkidentity”.
I've tried it with Force code signing with Provisioning Profile, with Force code signing with Identity, without either and various other permutations. Changing the Code Signing Identity from iOS Developer to Don't Code Sign in the framework's Build Settings. Etc.
I've left Code Sign on Copy on in the Build Phases of the main project.
Nothing seems to work.
It's my understanding that an embedded framework should just sign with the iOS Developer identity as you archive a project.
-
The project archive's fine on my local machine.
Environment & info:
Using a workspace, the embedded framework does have it's own pods, as does the main project.
I'm using Xcode 7.3 on OS X 10.11.6
The provisioning profile is an iOS UniversalDistribution type one.
The Bitrise workflow is using:
Certificate and profile installer - 1.7.0
Xcode: Create Archive - 1.9.2
If any other info is needed or anything needs clarifying let me know!
Thank you!!
You should not use "Force code signing with Provisioning Profile" in this case, as that (this is simply an option passed to Xcode) will force that specific profile to be used for every part of the project!
You can find more information here: https://bitrise-io.github.io/devcenter/ios/code-signing/#full-manual-full-control
TL;DR; don't use a full Provisioning Profile ID, rather use "Force Identity" if you really have to (and maybe just a category for Force Prov Profile, like "iPhone Distribution"), Xcode will figure out which profile to use, based on the Identity and bundle IDs etc.
That said, since Xcode 7 the recommended way is to use "Export Options Plist", and in Xcode 8 if you opt-in for automatic code signing that's your only option. In short, the recommended way is to do an initial signing with development code signing, and then specify the "export method" for Xcode (in case of Bitrise this is an option of the Xcode Archive step). The only this to note here is that you need both development and distribution certs & profiles to be available. But once you do, selecting the right one for distribution is as easy as setting the "export method" option (Xcode Archive step) to the type you want to use (e.g. ad-hoc or app-store).
More info: https://bitrise-io.github.io/devcenter/ios/code-signing/#using-export-options-available-for-xcode-7-and-xcode-archive-step-v191
P.S.: if you'd want to migrate to the new code signing options you should reset the inputs you previously specified - probably the fastest way, if you use the Web UI, is to remove the Xcode Archive step, and then add a new one to the same spot.

How to sign an iOS Framework

No matter what I do when trying to build my iOS Framework, I get this error:
"CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 9.3'"
The only "solution" I found through searching was to ensure the framework's project's "Team" is set to None. That apparently solved the problem for some people, but I still get the same error.
Since that solution was for SDK 8.x I'm wondering if there's something new in SDK 9.x that no longer allows creation of unsigned frameworks?
If I sign it with my developer wildcard credentials, the consuming app is unable to upload to the app store because of a distribution certificate incompatibility.
So is an unsigned ios Framework impossible...?
It doesn't related to framework signing.
Your provisioning profile is wrong.
You must generate provisioning profile exactly.
And you must set up provisioning profile in Xcode Build Setting for code signing.
If your provisioning profile is correct, it will be matched definitely.

iOS8 Dynamic Frameworks -> CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.3'

I am using the iOS8 Dynamic Frameworks that I build myself and link within my iOS app. It was working fine in the simulator and on device, but when trying to archive a Release build for it, I keep getting this error:
Code Sign error: No matching provisioning profiles found: None of the valid provisioning profiles allowed the specified entitlements: com.apple.developer.ubiquity-kvstore-identifier, keychain-access-groups, com.apple.developer.icloud-container-identifiers, com.apple.developer.icloud-services, com.apple.security.application-groups, com.apple.developer.ubiquity-container-identifiers.
CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.3'
Within the app target -> Build Phases -> Embed Frameworks -> the framework is linked there, and "Code Sign on Copy" checkbox is checked.
Within the framework target -> Build Settings -> I have set Provisioning Profile to "Automatic", and for Code Sign Identity, under Release, I am using "iOS Distribution"
I have 3 different app targets that need to build off this Framework.
I'm confused:
does the framework need it's own AppID registered in the Developer Center?
does the framework need it's own Provisioning Profile?
can the framework use the same Entitlements file from the iOS app target?
Thanks.
I had the same problem but fixed it by:
Setting the team to None in the General tab of the target settings.
Changing this value seems to also reset the code signing params in the build settings, to 'iOS Developer' for both debug and release. If it doesn't then change these params yourself.
I can now build my framework with no errors.
The newly built framework can be checked for signing by entering codesign --display --verbose=4 FRAMEWORK_PATH into the terminal.
This tool should return: code object is not signed at all
The framework does not need its own app ID registered in the developer center, provisioning profile, or entitlements. I have an app on the app store that contains an app target, a today extension target, watch extension targets, and a framework target for shared code.
I was encountering this issue with a second app I was attempting to setup a build for, and I was able to resolve it by changing the signing for my framework to use automatic settings instead of "Don't Code Sign" (iOS Developer identity / Automatic profile). This causes the error to go away and the framework still seems to be resigned during the archive as one would expect. It seems that some build settings are required, even if it is just going to resign.
EDIT: It's worth mentioning that once you set it to automatic, you must also have a provisioning profile installed that is appropriate for the bundle id set for the targets being built (a wildcard development profile should suffice).

Xcode 6 - failed to locate or generate matching signing assets

Error:
Failed to locate or generate matching signing assets and failed to do
so because of the following issues:
No matching provisioning profiles found for "Applications/myapp.app"
None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups.
While trying to distribute a company / in-house app:
I've upgraded from Xcode 5 to Xcode 6 and now my normal routine results in the above error. How to fix this? Tried renaming the distribution profile, restarting Xcode, letting Xcode generate it's own files, creating a new distribution certificate. What now?
I was able to fix this problem by changing the Architectures setting. I assume this was just a problem with Architectures/Valid Architectures being incompatible with one another.
After searching and trying many ways, my problem is resolved by first Product->Clean, then Archive again for validate/submit. Sounds a bit trivial, not sure if this can solve your problem.

Resources