# iOS SDK is not signed with latest code signature and app doesn't compile

**URL:** <https://community.piwik.pro/t/ios-sdk-is-not-signed-with-latest-code-signature-and-app-doesnt-compile/1276>\
**Category:** API & integrations\
**Created:** [November 19, 2022, 6:17pm UTC](https://community.piwik.pro/t/ios-sdk-is-not-signed-with-latest-code-signature-and-app-doesnt-compile/1276 "2022-11-19T18:17:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzamir](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/dzamir/32/958_2.png) [@dzamir](https://community.piwik.pro/u/dzamir)\
**Post date:** [November 19, 2022, 6:17pm UTC](https://community.piwik.pro/t/ios-sdk-is-not-signed-with-latest-code-signature-and-app-doesnt-compile/1276/1 "2022-11-19T18:17:58Z")

</div>

Hello,

I added the Piwik SDK to an iOS project by [following the documentation](https://developers.piwik.pro/en/latest/integrations/Piwik_PRO_SDK_for_iOS.html). In my Podfile I added: `pod 'PiwikPROSDK', '1.1.5'`, but the build on device always failed with non-descriptive errors.

I tried to understand the problem by integrating the xcframework directly without using Cocoapods and I received a better error when building to device:

```auto
Unable to install "AppName"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
    DVTErrorCreationDateKey = "2022-11-19 18:11:03 +0000";
    IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}
--
The code signature version is no longer supported.

```

While searching the error I found [This document by Apple](https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format) and it seems that the problem is that the PiwikProSDK framework for iOS is built with an old and unsupported signature version. From Apple’s documentation:

> To check whether an app called `MyApp.app` has the new signature, you can use the codesign utility:
> 
> ```auto
> % codesign -dv /path/to/MyApp.app
> 
> ```
> 
> …
> 
> Look in the output for a string such as `CodeDirectory v=20500`. For any value of `v`less than `20400`, you need to re-sign your app.
> 
> …
> 
> If your app contains nested code, such as an app extension, a framework, or a bundled watchOS app, sign each item separately, starting with the most deeply nested executable, and working your way out; then sign your main app last

This is the output of the command when executed on the PiwikProSDK Framework:

```auto
codesign -dv PiwikPROSDK.xcframework/ios-arm64_i386_x86_64-simulator/PiwikPROSDK.framework                                         
Executable=PiwikPROSDK.xcframework/ios-arm64_i386_x86_64-simulator/PiwikPROSDK.framework/PiwikPROSDK
Identifier=com.piwikpro.sdk
Format=bundle with generic
CodeDirectory v=20100 size=193 flags=0x2(adhoc) hashes=1+3 location=embedded
Signature=adhoc
Info.plist entries=20
TeamIdentifier=not set
Sealed Resources version=2 rules=10 files=8
Internal requirements count=0 size=12

```

As you can see, CodeDirectory returns v=20100 but it should be at least 20500.

---

<div class="post-metadata">

**Author:** ![Piotrek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/piotrek/32/160_2.png) [@Piotrek](https://community.piwik.pro/u/Piotrek)\
**Post date:** [November 21, 2022, 9:23am UTC](https://community.piwik.pro/t/ios-sdk-is-not-signed-with-latest-code-signature-and-app-doesnt-compile/1276/2 "2022-11-21T09:23:42Z")

</div>

Hello @dzamir,

We’ll check this and get back to you with feedback.

---

<div class="post-metadata">

**Author:** ![dzamir](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/dzamir/32/958_2.png) [@dzamir](https://community.piwik.pro/u/dzamir)\
**Post date:** [November 21, 2022, 7:46pm UTC](https://community.piwik.pro/t/ios-sdk-is-not-signed-with-latest-code-signature-and-app-doesnt-compile/1276/3 "2022-11-21T19:46:49Z")

</div>

I tried to replicate the problem in an empty Xcode project with the same Podfile but it compiled successfully.

At the end I updated all the CocoaPods on my (big) project and I can now compile on device and submit to store.
