Search code examples
ioscontinuous-integrationfastlane

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


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


Solution

  • 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):

    example mapping of provisional profiles

    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.)