IBDesignables, no suitable image found, required code signature missing - xcode

I recently made some changes to Assets.xcassets and this caused absolute chaos for XCode. I ended up with multiple errors of this kind: Failed to render and update auto layout status for *MyViewController* (6jf-cd-DYU) dlopen (AFramework.framework, 1): no suitable image found. Did find: Aframework.framwork: required code signature missing for 'Aframework.framework' in both .storyboard and .xib files.
Aframework is a placeholder for multiple Pod frameworks I have as dependencies. These worked fine before I modified xcassets.
I tried everything I could find related to this but I've gotten nowhere: Cleaned Derived Data, ran clean/build, removed all XCode cache folders, reinstalled XCode entirely, Refresh all views etc. It compiles and runs fine, everything works in the app (and no images or resources are missing), but all my Storyboards are blank (all white), which makes it pretty hard to work.
I also tried pod deintegrate, removed the xcworkspace-file and reinstalling pods (since the error points to a Pod framework). I also revoked and re-issued all my certificates through XCode since it points to code signing as a problem.
EDIT: I Completely reinstalled OSX and cloned the repo from Git from a working configuration. No change. This must be something other than the xcassets-theory, because even if I check out commits from weeks ago (where I know for sure this wasn't a problem) I still get the error. Maybe something was updated by Apple between now and the last time it worked. I've given up and moved on for now. I'll just click through the views in the explorer on the left side instead of inside the storyboard. Hopefully someone somewhere figures this out at some point.

This issue looks like Cocoapods bug and caused by CODE_SIGNING_ALLOWED and CODE_SIGNING_REQUIRED keys in settings of Pods.
Adding this code in the end of pod file will fix an issue (don't forget do then pod install):
# Workaround for Cocoapods v.1.5 issue #7606
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end

It turns out this was related to cocoapods. 1.5 has issues with XCode 9.3 it seems. I downgraded to cocoapods 1.4 and the issue went away. Please see this thread on GitHub.
Edit: This issue has been fixed. The latest version of CocoaPods no longer suffers from this problem, so all you have to do is update.

Just adding a complete version of Igor's answer
Please don't downgrade cocoapods. Instead modify pod files as bellow.
#Replace 9.0 with your project ios version
platform :ios, '9.0'
target 'YourProject' do
frameworks
use_frameworks!
pod 'Alamofire', '~> 4.7'
pod 'AlamofireObjectMapper', '~> 5.0'
pod 'SDWebImage', '~> 4.0'
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end

Related

Trying to Rebuild a Legacy IOS App, Getting Error in Facebook-IOS-SDK Cocoapod

I've been asked to rebuild an existing IOS app that uses Facebook-IOS-SDK. The app is at least 5 years old so I expected things to be deprecated. I have some limited experience with XCode and IOS but I'm far from an expert. I've never used cocapods until today. I installed cocoapods and ran pod init. Facebook-IOS-SDK ver 3.24.4 loaded with no errors (other pods too, including Bolt, with no errors).
I've read the migration notes on the FB dev page regarding the versions and it's implied that I should be able to use 3.24. When I do a clean build I get the error:
(FBRequest *)requestForUpdateOpenGraphObject(id<FBOpenGraphObject>)object
{
return [FBRequest requestForUpdateOpenGraphObjectWithId:object[#"id"] graphObject:object];
}
Expected method to read dictionary element not found on object of type 'id<FBOpenGraphObject>'
This error is in FBRequest.m, the cocoapod code, not in my clients code. This code is marked read only. If this is the correct pod version, and I can't change it then is there some other dependency in the (large) project that needs to be updated?
Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, "9.0"
target "tbd" do
pod 'IQKeyboardManager'
pod 'UICKeyChainStore'
pod 'CocoaLumberjack', '~> 2.0.0-beta'
pod 'SDURLCache'
pod 'HockeySDK'
pod 'Facebook-iOS-SDK', '~> 3.23'
pod 'GoogleAnalytics-iOS-SDK'
pod 'UIActionSheet-Blocks', '~> 1.0'
end
target "tbdTests" do
end
The only, nasty, solution I found is to change the code inside FBRequest.m manually.
Change line 370 from:
return [FBRequest requestForUpdateOpenGraphObjectWithId:object[#"id"] graphObject:object];
to
return [FBRequest requestForUpdateOpenGraphObjectWithId:object.objectID graphObject:object];
this should make you project runs again.
Again, this is not a nice solution, but it works :)
Emilio
if you don't have the need to use Facebook-IOS-SDK ver 3.24.4 you can simply use the latest version 4.36.0.
have a look at your Podfile and see if there is any reference to Facebook-IOS-SDK, if there is something like:
pod 'Facebook-IOS-SDK', '~> 3.0'
you can replace it with:
pod 'Facebook-IOS-SDK', '~> 4.0'
otherwise post your Podfile and we can have a look.
Cheers

Xcode - #IBDesignables - Required code signing missing for X.framework

I know similar questions has been asked before but nothing seems to work for me.
Im using CocoaPods and installing framework "X". This can be anything that can be edited directly in the Storyboard. Two examples are "MBCircularProgressBar" and "UICircularProgressRing".
Im adding it to a UIView and getting this error instantly. It messes up my storbyboard but the app is running fine.
I'm using the newest version of Xcode, newest MAC OS.
What have i tried?
Deleted everything in DerivedData for Xcode
Clean, build, refresh views ++
Removing the problem pods and reinstalling/trying a different one
Disabled "Automatic code signing" in "General" and set it manually to my company
Error at the moment shows :
Main.storyboard: error: IB Designables: Failed to render and update auto layout status for Dashboard_UsageVC (mqT-RZ-029): dlopen(MBCircularProgressBar.framework, 1): no suitable image found. Did find:
MBCircularProgressBar.framework: required code signature missing for 'MBCircularProgressBar.framework'
UPDATE 23.04.2018 - Still not solved
Still having this problem. I have gone to the extreme and fully reset my MAC. Reinstalled everything. Same problem. Even when downgrading CocoaPods to 1.4.0 and Xcode to previous version. To avoid pulling all my hair out Im now finishing the rest of the app where nothing special is needed and hoping for a magic solution for this closer to app release.
It has been fixed with Cocoapods 1.5.2 (and probably 1.5.1 but I have upgrade directly from 1.5.0 to 1.5.2).
UPDATE
I may have spoken too fast.
The error re-appears after a few builds.
However, this workaround seems to work (applies to Cocoapods 1.5.x) until the bug fix is merged:
clean your project
close Xcode and delete DerivedData
open Podfile in your project , and add this:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end
then in command line do a:
pod update or pod install
Sources:
https://github.com/CocoaPods/CocoaPods/issues/7606#issuecomment-381279098
https://github.com/evgenyneu/Cosmos/issues/105
https://github.com/Skyscanner/SkyFloatingLabelTextField/issues/201#issuecomment-381915911
Same bug for me.
For me, it cames after installing the last version cocoapods 1.5.0. So I downgraded it to 1.4.0 and the bug disappear.
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.4.0
Hoped it will helped you too.
This works fine for me.When I downgrade cocoapods to 1.4.0,the problem disapper.
I am using DownloadButton.

Cocoapods use_frameworks! caused strange compiler errors in the old OC codes

I added use_frameworks! in my pod file, running pod install again (without any other changes). Then I got the compiler error like 'Masonry.h' file not found with <angled> include; use "quotes" instead.
Although I believed those pod header files should be used with <...> I did change them to "...". But then I got the error like Redefinition of 'FMTokenizerCursor' (from FMDB pod)
I felt like this maybe a cocoapod bug (I am using 1.0.1) so I upgraded it to cocoapods-1.1.0.beta.2, same error. pod deintegrate & pod install made no difference.
I found these is a similar question here. But the answers there did not work for me.
I tried both Xcode 7 & 8, clean ~/Library/Developer/Xcode/DerivedData
same error too.
I met the same problem as you, I try to search for Search Paths in the Build Settings of the project, then add to the User header search paths $ (SRCROOT) and select recursive. But that does not work ... Then I put the "use_frameworks!" was removed from the podfile, recompile the project, problem solved =-=
Here's an example for a Podfile using the new format. (This example project has 2 targets), Try it.
also, make sure you don't edit this file in textEdit. (xCode is preferred)
abstract_target 'YourProject-abstract' do
use_frameworks!
pod 'Alamofire', '3.5.0'
pod 'ObjectMapper'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'AlamofireImage'
target 'MyProject' do
end
target 'MyProject-staging' do
end
end

SDK image not found when running OSX UI Tests with Cocoapods

I am trying to add my first automated UI tests to my application and am running into quite a bit of difficultly.
The app will build in its current state and the main application itself runs just fine. However, when I try to run my tests I get the following error:
2016-08-02 19:39:33.340 XCTRunner[17590:966857] Running tests...
2016-08-02 19:39:33.407 XCTRunner[17590:966857] The bundle “MYAPPUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-08-02 19:39:33.407 XCTRunner[17590:966857] (dlopen_preflight(/Users/username/Library/Developer/Xcode/DerivedData/MYAPP-bdpxtxtxmsobtreqnojvykobjlts/Build/Products/Debug/MYAPPUITests-Runner.app/Contents/PlugIns/MYAPPUITests.xctest/Contents/MacOS/MYAPPUITests): Library not loaded: #rpath/HockeySDK.framework/Versions/A/HockeySDK
Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/MYAPP-bdpxtxtxmsobtreqnojvykobjlts/Build/Products/Debug/MYAPPUITests-Runner.app/Contents/PlugIns/MYAPPUITests.xctest/Contents/MacOS/MYAPPUITests
Reason: image not found)
I've seen that there are a few related questions on SO but none of them see to help me out.
Originally, I was implementing my tests in Swift on top of an Objective C application and thought that might be the problem. However, I discovered after making an Objective-C based test target that I am running into exactly the same issue in Objective C.
Thanks for any help.
EDIT
Some additional information: I have tried this using both Cocoapods 0.39.0 as well as the latest non-beta 1.x release. Both resulted in the same error.
My podfile is listed below (for 0.39.0)
platform :osx, '10.9'
link_with 'MYAPP', 'MYAPP MAS', 'MYAPPUITests'
pod 'AFNetworking', '~> 2.5.0'
pod 'ISO8601DateFormatter'
pod 'CDEvents', :git => 'https://github.com/rastersize/CDEvents'
pod 'MASShortcut', '1.3.1'
pod 'libPusher', '1.6'
pod 'NPReachability', :git => 'https://github.com/Abizern/NPReachability.git', :commit => 'e57753d'
pod 'CocoaLumberjack'
pod 'SocketRocket', :git => 'https://github.com/marianoabdala/SocketRocket.git'
pod 'HockeySDK-Mac'
pod 'INAppStoreWindow', '~> 1.4'
I was able to fix this after spending 2-3 days on this by adding an obscure step to my Build Phases.
I created a Copy Files build step after the Link Binary With Libraries step and before the Embed Pods Frameworks step.
I copied the offending framework ("HockeySDK") into the Products Directory. This solved the issue!
Ultimately this may be related to my app being a StatusBar App, not a regular app, as the solution which finally worked for me was related to a CommandLine application running into the same bug.
Link to Github bug page with the solution that worked for me

GCDWebServer fails to comile when CocoaLumberjak is included in project

When using cocoapods, with those 2 libs:
pod "GCDWebServer", "3.3.2"
pod 'CocoaLumberjack', '2.2.0'
Project fails to compile, as GCDW does not link to LumberJack (even optionally).
Adding Lumberjack to "Linked Grameworks and Libraries" as optional, for GCDWS pod fixes the issue, but it is only a workaround, as each
pod install resets the state, making it pain in the a$$ to work with, and impossible to have it build by CI env.
Any ideas of how to solve that?
BTW - GCDWebServer guys, why you have dissabled issues on GitHUb!?
This was fixed by https://github.com/swisspol/GCDWebServer/pull/256. Use this in your podspec:
pod 'GCDWebServer/CocoaLumberjack'

Resources