开发者

How to fix "failed codesign verification" of an iPhone project?

Last night, the iPhone project was built perfectly.

This morning, I installed XCode 3.2.3 in a separate f开发者_如何学运维older. When I open the same project in the old XCode 3.2.2 and re-built the project. I got this warning:

Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)

How can I fix it? Thanks!


For me the following steps resolved the issue:

  1. Go to Product > Edit Scheme.

  2. Open the Archive Profile.

  3. Set Build configuration to Distribution.


I've encountered the same problem too. It showed that I had a duplicate certificate registration in my keychains. Removing one of them (I removed the one from my system keychain) fixed the problem.

Steps that helped me to resolve my problem:

  1. Open KeyChain Access application
  2. Select the 'login' keychain, and select in the bottom pane 'Certificates'
  3. Switch to the 'system' keychain and see if there are certificates registered in both chains.
  4. Remove one of them
  5. Rebuild the application


I had the same problem, seems 3.2.3 messes with codesigning. I fixed it by re-running the 3.2.2 installer, no need to uninstall anything.


The parallel XCode problem can be addressed using the command line tool "xcode-select"

I found a similar problem caused by having XCode 4.2 beta installed. One of the embedded entitlements files was being placed in a different directory and was causing a file not found error.

The solution was to use xcode-select to verify and fix the XCode path.


Besides googling for possible solutions to this problem and trying them out (hoping that they help), here is an advice how to diagnose what causes this. The steps below apply to Xcode 4.2.

  1. In menu, select View > Navigators > Show Log Navigator. The Log Navigator should be displayed on the left side.
  2. In the list of builds, select the one that causes troubles. The log from the build will be shown in the main view.
  3. Scroll to the very bottom. The last two steps should be CodeSign and Validate, where the Validate step contains the warning.
  4. Expand CodeSign and inspect the parameters used to perform the code signing.
  5. Expand Validate to learn more about the errors/warnings.

Also scroll up and inspect the heading for the build target:

Build Target (your build target)

Project (your project) | Configuration (selected configuration) | Destination ...

In my case, I found out that while doing the Archive build, the app was signed with the developer certificate. Inspecting the heading for the build target revealed that the Release configuration was used to build the archive. The remedy was to:

  1. In the menu, select Product > Edit Scheme
  2. In the Edit Scheme dialog, select the Archive build item (list on the left)
  3. Change Build Configuration to Distribution

I had this issue after duplicating a build target. The original target was signed by the distribution certificate. However, when copying the target, Xcode decided to assign the Release configuration to the Archive build.


This happened to me today as I was moving an existing project into a new Git repository structure, while simultaneously using a development certificate obtained via being added to my client's team as a "Member". So lots of opportunity for things to screw up.

In my case, the issue turned out to be the "Build Products Path". I had it set to the relative path "../../../build" instead of an absolute path. This was causing the Validate tool to screw up since the actual path wasn't being collapsed properly. I changed it to an absolute path and the Validate tool then began to run successfully once more.

I submitted this as a bug to Radar as #8946204.


This is kind of an old post but I wanted to share what I learned (really remembered because I forgot this part.) I was trying to build my project against an ad-hock profile. I had forgotten that I needed to create a separate App Store profile (Provisioning Portal -> Provisioning -> Distribution). This was my first app I've submitted and the documentation is overwhelming so I missed/forgot about this part. Once I created the App Store profile and installed in XCode everything worked fine. Just wanted to throw this out there in case anyone else has this same issue.


Due to what hiroshi said you can change it there: I just do is:

  • Open the Organizer
  • Go to Devices
  • Provisioning Profile
  • Click on the Profile you want to use. There you will see the profile identifier key.
  • Open the xcode project via textfile (the file in the xcodepj bundle)
  • Go to those lines and put the key in here
@@ -325,6 +325,7 @@
                            PREBINDING = NO;
 +                               "PROVISIONING_PROFILE[sdk=iphoneos*]" = "key goes        here";
                            SDKROOT = iphoneos;
 @@ -361,6 +362,7 @@
                            PREBINDING = NO;
 +                               "PROVISIONING_PROFILE[sdk=iphoneos*]" = "and also here";
                            SDKROOT = iphoneos;
  • Save changes and restart the Project

!!!That's what worked for me in XCODE 4!!!


If you go to the Organizer and select Provisioning Profiles, is the profile listed there? If so, have you checked that it's setting in the Project Settings/Build/Code Signing section?


I'm not sure, but reverting those changes in the project.pbxproj rescues me from failing to start my app in devices. The warning subject of the question remain though.

@@ -325,6 +325,7 @@
                                PREBINDING = NO;
+                               "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
                                SDKROOT = iphoneos;
@@ -361,6 +362,7 @@
                                PREBINDING = NO;
+                               "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
                                SDKROOT = iphoneos;


I fixed this simply by deleting my distribution certificate from keychain then downloading it again from the provisional profile


For the build warning or archive validation error "Application failed codesign verification", see Apple's complete list of potential causes at the following URL "How do I resolve the error: Application failed codesign verification?"

Best,


Simple Solution: Build your app using a DISTRIBUTION certificate and not a Developer cert.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜