Code signing generated with wrong version

I have some issues linking some frameworks when I run my iOS application. The issue comes as code signing version is not supported. I use Carthage for the dependency management. It links the framework then has the copy-framework script where it copies to the framework and does the code signing.

For code signing it does the same thing codesign --force --sign ****** --preserve-metadata=identifier,entitlements path_to_framework

The CodeDirectory for some frameworks after signing is 20200 and for others 20400. Obviously 20200 is not supported anymore hence the issue, although I don’t under why does it assign an old version number to it when it's been signed the same way in Big Sur.

I have Xcode 12.3 and using Big Sur 11.4.

Framework where it’s not working:

Executable=********/Frameworks/FirebaseCore.framework/FirebaseCore
Identifier=com.firebase.Firebase-FirebaseCore
Format=bundle with generic
CodeDirectory v=20200 size=226 flags=0x0(none) hashes=1+3 location=embedded
Signature size=4886
Signed Time=18 Jun 2021 at 16:15:27
Info.plist entries=7
TeamIdentifier=********
Sealed Resources version=2 rules=10 files=1
Internal requirements count=1 size=196

Framework where the code signing works properly:

Executable=********/Frameworks/RxSwift.framework/RxSwift
Identifier=io.rx.RxSwift
Format=bundle with Mach-O universal (arm64)
CodeDirectory v=20400 size=74833 flags=0x0(none) hashes=2332+3 location=embedded
Signature size=4886
Signed Time=18 Jun 2021 at 16:16:07
Info.plist entries=21
TeamIdentifier=********
Sealed Resources version=2 rules=10 files=0
Internal requirements count=1 size=176

Any idea what the issue can be?

Replies

You manually sign the problematic framework does that still result in it generating the old version?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • ^You^If you

Add a Comment

Same thing here.

Same here. Some of my frameworks are signed with CodeDirectory v=20400 and some others are signed with CodeDirectory v=20200. The frameworks that are signed with CodeDirectory v=20200 are causing my local deployments to my device to fail.. I've set the frameworks signed with 20200 to Do Not Embed as a workaround. However, this only works for static libraries

Did you try my suggestion above?

To be clear, this isn’t intended to be a fix but rather a diagnostic test.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I'm encountering this same issue and would love to know if any solution was found.

What happens if you run the diagnostic test I suggested in my initial response?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Just stumbled upon this issue when using an XCFramework Swift package and found a solution. To enforce a specific code signing version you need to use two extra command line options:

-o, --options flag,...

During signing, specifies a set of option flags to be embedded in the code signature. The value takes the form of a comma-separated list of names (with no spaces). Alternatively, a numeric value can be used to directly specify the option mask (CodeDirectory flag word). See OPTION FLAGS below.

--runtime-version version

During signing, when the runtime OPTION FLAG is set, explicitly specify the hardened runtime version stored in the code signature. If this option is omitted, but the runtime OPTION FLAG is set then the hardened runtime version is omitted for non-Mach-O files and derived from the SDK version of Mach-O files.

Adding the following options will result in a v=20500:

 runtime --runtime-version "16.4.0"

After this the app successfully installs on a device.

You can add those option to the OTHER_CODE_SIGN_FLAGS in the Build Settings of your app target.