Why is my iOS code signing failing with a certificate subject length warning in Codemagic?

Last updated: October 3, 2026

Context

You may encounter an iOS build failure during the code signing configuration step, accompanied by the following error and warning:

  • Failed to set code signing settings for ios/Runner.xcodeproj

  • UserWarning: Attribute's length must be >= 1 and <= 64, but it was 70

This can occur even when your certificates and provisioning profiles are valid and have not been changed.

Answer

The root cause of this issue is typically found in your ios/Runner.xcodeproj/project.pbxproj file. The CURRENT_PROJECT_VERSION (and potentially MARKETING_VERSION) build settings are missing quotation marks around variable references, which causes the code signing step to fail.

To resolve this, follow these steps:

  1. Open ios/Runner.xcodeproj/project.pbxproj in a text editor.

  2. Locate the CURRENT_PROJECT_VERSION entry. If it looks like this:

    CURRENT_PROJECT_VERSION = $(FLUTTER_BUILD_NUMBER);

    Update it to wrap the value in quotes:

    CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
  3. Similarly, check the MARKETING_VERSION entry in the same file and apply the same fix if needed.

  4. Commit and push the changes to your repository.

  5. Retry the build in Codemagic.

Ensuring that variable references in your .pbxproj file are properly quoted prevents Xcode from misinterpreting the values during the code signing configuration step.