iOS manually built framework fails when installing app with Application Signature Not Valid

Hi everyone,


I'm attempting to export my library as a .framework to be used in iOS apps. When I link the framework into a test app (simple app, one view controller that does nothing) and attempt to install the app on a device it fails to install on the device saying "App installation failed. The application does not have a valid signature.". If I don't link the .framework it all installs fine.


After looking around at these and other forums (primarily StackOverflow), I found that looking at the device logs provides a little bit more information about the error. Device logs:

Dec 24 14:32:48 Indigos-iPhone installd[40] <Error>: 0x1005a4000 -[MICodeSigningVerifier performValidationWithError:]: 188: Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.pRDquy/extracted/LibraryTesting.app/Frameworks/Company.framework identifier = com.company.Company type = Framework> : 0xe8008019 (Application signature not valid)
Dec 24 14:32:48 Indigos-iPhone installd[40] <Error>: 0x1005a4000 -[MIInstaller performInstallationWithError:]: Verification stage failed
Dec 24 14:32:48 Indigos-iPhone streaming_zip_conduit[256] <Error>: 0x100384000 __MobileInstallationInstallForLaunchServices_block_invoke240: Returned error Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.pRDquy/extracted/LibraryTesting.app/Frameworks/Company.framework identifier = com.company.Company type = Framework> : 0xe8008019 (Application signature not valid)" UserInfo=0x1255213d0 {LibMISErrorNumber=-402620391, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=188, FunctionName=-[MICodeSigningVerifier performValidationWithError:], NSLocalizedDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.pRDquy/extracted/LibraryTesting.app/Frameworks/Company.framework identifier = com.company.Company type = Framework> : 0xe8008019 (Application signature not valid)}
Dec 24 14:32:48 Indigos-iPhone streaming_zip_conduit[256] <Warning>: ERROR: MobileInstallationInstallForLaunchServices returned nil
Dec 24 14:32:48 Indigos-iPhone streaming_zip_conduit[256] <Warning>: __dispatch_source_read_socket_block_invoke:203: Failed to install application at file:///var/mobile/Media/PublicStaging/LibraryTesting.app/ : Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" UserInfo=0x1255214e0 {Error=ApplicationVerificationFailed, ErrorDetail=-402620391, ErrorDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.pRDquy/extracted/LibraryTesting.app/Frameworks/Company.framework identifier = com.company.Company type = Framework> : 0xe8008019 (Application signature not valid)}


All I get from those logs is that it is my framework (Company.framework) is causing the issue.


I have built the .framework by hand (as I use a build system that requires me to write the script to construct the .framework file). It's structure is:


Company.framework
Company.framework/_CodeSignature
Company.framework/_CodeSignature/CodeResources
Company.framework/Headers
Company.framework/Headers/Company.h
Company.framework/Headers/CompanyDelegate.h
Company.framework/Headers/CompanyView.h
Company.framework/Info.plist
Company.framework/Modules
Company.framework/Modules/module.modulemap
Company.framework/Company


Note: I have tried having all of the contents in Versions/A and then symlinked through Versions/Current to the root of the .framework.


The only thing I think it could be is the Info.plist. But I have taken an Info.plist from a simple framework built by Xcode and then done minor changes (e.g. Name, package identifier) to make it applicable to my framework.


Any help would be greatly appreciated.


Cheers

Indigo

If those minor changes were done outside of Xcode, that plist may not be in the proper format now.


How, exactly did you edit it? With what tool/application?

It sounds like you're not signing your framework (and possibly app) correctly. You should inspect the output of 'codesign -vvv /path/to/Company.framework' and 'codesign -vvv /path/to/My.app'

Jeremy - Is there any chance Apple will deal with the constant spam here?

The app (and from it, the framework since I have it being embedded and signed using the Embed Framework utility in Xcode) is being signed by Xcode. Any reasons why Xcode would be failing therre?

Please provide the output of running codesign as suggested.

Hi Jeremy,


My apologies for the delayed response.


Here are the codesign outcomes (with associated commands):

App:

$ codesign -vvv /Users/indigo/Library/Developer/Xcode/DerivedData/LibraryTesting-azmocmdalqwlfochyihtxugfcdhs/Build/Products/Debug-iphoneos/LibraryTesting.app
/Users/indigo/Library/Developer/Xcode/DerivedData/LibraryTesting-azmocmdalqwlfochyihtxugfcdhs/Build/Products/Debug-iphoneos/LibraryTesting.app: valid on disk
/Users/indigo/Library/Developer/Xcode/DerivedData/LibraryTesting-azmocmdalqwlfochyihtxugfcdhs/Build/Products/Debug-iphoneos/LibraryTesting.app: satisfies its Designated Requirement


Framework in app:

$ codesign -vvv /Users/indigo/Library/Developer/Xcode/DerivedData/LibraryTesting-azmocmdalqwlfochyihtxugfcdhs/Build/Products/Debug-iphoneos/LibraryTesting.app/Frameworks/Company.framework/
/Users/indigo/Library/Developer/Xcode/DerivedData/LibraryTesting-azmocmdalqwlfochyihtxugfcdhs/Build/Products/Debug-iphoneos/LibraryTesting.app/Frameworks/Company.framework/: valid on disk
/Users/indigo/Library/Developer/Xcode/DerivedData/LibraryTesting-azmocmdalqwlfochyihtxugfcdhs/Build/Products/Debug-iphoneos/LibraryTesting.app/Frameworks/Company.framework/: satisfies its Designated Requirement


Framework in directory:

$ codesign -vvv Company.framework/
Company.framework/: code object is not signed at all



Cheers

Indigo

Odd. Please file a radar at http://bugreport.apple.com and include a tarball of the app bundle that you are trying to install. Please report back the number in this thread, so I can easily cross-reference. Thanks.

This problem is happening to me too. I can only see it when trying to install on iOS 8.4.1 but it works just fine on iOS 9.2


PS1. My framework is built using 'Static Library' and it works just fine if it's 'Dynamic Library'

PS2. I tried both unsigned as well as signed versions of the library and both got me to the same error.

Hi XperielIndigo,

I still couldn't figure out how to fix this issue. Were you able to find any solution?

Thanks.

Just to say, I've wasted days trying to get around this issue.


Last week, Xcode 7.3.1 was building an in-house version of my app without problems. But this week, I keep hitting problems, including this error.

Eventually, I hit rock bottom.


I deleted our company's Signing Certificate, recreated the Provisioning Profiles, everything, but the deployment still didn't work.


And then I rebooted my iPad.


Now, during a deployment phase (like now) I always refuse my iPad from being upgraded. But after rebooting, it went through the screens of setting up the new version, and then, magically, I was able to download & install my iPad app from the website.


What a complete waste of time, and disasterously incompetent error reporting from Xcode.


Seriously, I loathe this environment.

You guys must really hate developers.


By the way, after recreating the Provisioning Profile, I noticed that I was unable to remove the old Provisioning Profiles from Xcode.

I had to Google for a solution, which involved opening Terminal and manually deleting some files.

Seriously guys ? This is 2016.


Is Xcode ever going to grow up ?



Angry Mike

I have excactly the same problem. Does anyone found solution for this? Thanks!

iOS manually built framework fails when installing app with Application Signature Not Valid
 
 
Q