2

from yesterday I'm unable to build and run my project on iOS 10 simulator with Xcode 8.1 The strange thing is that build and run work fine for real devices. The issue is:

.../Xcode/DerivedData/Tripla_Doppia-fllujkpnletlmwcswbkopyphtkqd/Build/Products/Debug-iphonesimulator/Appirater.bundle: bundle format unrecognized, invalid, or unsuitable Command /usr/bin/codesign failed with exit code 1

I tried to clean project and clean Derived Data's folder, but nothing is changed. I'm using CocoaPods to manage libraries, included the Appirater pod. Build and run worked fine until last week. Any suggestion?

This is link to screenshot:

enter image description here

Ronak Chaniyara
  • 5,335
  • 3
  • 24
  • 51
Francesco
  • 33
  • 2
  • 8
  • 1. Delete Derived data 2. Clean the project and try to run your project again. – Wolverine Nov 02 '16 at 13:23
  • I followed your suggestion, but build failed again. – Francesco Nov 02 '16 at 13:30
  • 1
    it seems an problem with code signing. surprisingly it should not affect for simulator though. – Wolverine Nov 02 '16 at 13:34
  • 2
    Finally, I found a solution. I updated CocoaPods to the latest version (1.1.1, it was 0.3.9) and now the build succeeded. I didn't understand why, but it works. Maybe there were problems between Xcode 8.1, CocoaPods 0.3.9 and pods that I use, because with Xcode 8.0 the project hadn't any issue. – Francesco Nov 02 '16 at 14:24
  • see also: http://stackoverflow.com/questions/29271548/code-sign-error-bundle-format-unrecognized-invalid-or-unsuitable/40464163#40464163 – George Stocker Nov 07 '16 at 21:44

5 Answers5

1

This issue can be caused because of CocoaPods as Francesco said.

CocoaPods and any pods is reference a resource path which does not exist can cause the problem.

Like for pods reference to a resource path which does not exist,

s.resource_bundles = {  
    'aPod' => ['Pod/Assets/*.png']  
}

Thread here seems to help.

Ronak Chaniyara
  • 5,335
  • 3
  • 24
  • 51
1

Via the same thread Ronak Chaniyara mentioned, I found an answer for people not looking to update their CocoaPods just yet.

If you look in the Pods project file, under targets, you'll notice that all the resource bundles don't have an Info.plist file set. Set them using CocoaPods generic Info.plist and it will run on simulator. This however is not permanent as it will reset on next pod install

If you are using CocoaPods (especially an older version), you'll notice that all the resource bundle targets in the pods project file don't have an info.plist. Set them all using CocoaPods generic Info.plist and it'll run. This however is not a permanent solution. It will reset on next pod install

https://forums.developer.apple.com/thread/66538

EDIT: If you don't happen to have a generic plist file in your project already create a new file Info.plist in Pods Target Support Files/Pods-<App Name>/ and paste this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>CFBundleDevelopmentRegion</key>
  <string>en</string>
  <key>CFBundleIdentifier</key>
  <string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
  <key>CFBundleInfoDictionaryVersion</key>
  <string>6.0</string>
  <key>CFBundleName</key>
  <string>${PRODUCT_NAME}</string>
  <key>CFBundlePackageType</key>
  <string>BNDL</string>
  <key>CFBundleShortVersionString</key>
  <string>1.0.0</string>
  <key>CFBundleSignature</key>
  <string>????</string>
  <key>CFBundleVersion</key>
  <string>${CURRENT_PROJECT_VERSION}</string>
  <key>NSPrincipalClass</key>
  <string></string>
</dict>
</plist>
JoshK
  • 479
  • 5
  • 6
0

I tried updating cocoapods 1.1.1, deleting DerivedData, and almost everything else mentioned. I still had the same problem. I just upgraded to Xcode 8.2 beta. Now everything works just like it did before I upgraded to Xcode 8.1.

0

I had a variant of this problem, when it seemed that a pod wasn't being recognized when I was building for the simulator (no problem when building for a real device). In my case, the solution was to remove the pod from my Podfile, do a pod install, then re-add the pod and do another pod install. This solved the problem.

CKP78
  • 630
  • 8
  • 19
0

In my case, issue caused due to Build for active architechture only in Pods target. Set to No, to support all devices for pods to build.

virtplay
  • 550
  • 7
  • 18