Francesco
Francesco

Reputation: 33

Xcode 8 build fail only for simulator

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

Upvotes: 2

Views: 2352

Answers (5)

virtplay
virtplay

Reputation: 578

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.

Upvotes: 0

CKP78
CKP78

Reputation: 650

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.

Upvotes: 0

CloudspyreSteve
CloudspyreSteve

Reputation: 49

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.

Upvotes: 0

JoshK
JoshK

Reputation: 479

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>

Upvotes: 1

Ronak Chaniyara
Ronak Chaniyara

Reputation: 5435

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.

Upvotes: 1

Related Questions