Libraries from Cocoapod are not found by Xcode compiler - xcode

I have a project that has the Podfile with the following configuration
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'CDA' do
pod 'RestKit', '~> 0.27.0'
pod 'ZBarSDK', '~> 1.3.1'
end
I use the Pod install command and I get the following result
But when I try to build the project on Xcode, I received the following error:
For some reason, the compiler was not able to find the libraries from cocoapod.
How can I fix this error?

I found a way to fix the problem.
I follow the guide on this site
https://guides.cocoapods.org/using/troubleshooting.html
What fix the problem for me is the step number 5.
I add the Libraries direct to build now and at the moment it works now for me, all builds are working now.

Related

No such module ZFDragableModalTransition in Swift

I have a xCode project. I am trying to run FolioReaderKit. I've installed the all project requirements such as CocoaPods and Carthage and I've fixed the errors except ZFDragableModalTransition.
I've downloaded it and added into my project over and over, I've added it as a Link Binary but I'm still getting same error. "No such module ZFDragableModalTransition in Swift"
I am very new in swift and Xcode therefore I might be make a mistake but I didn't manage it yet.
Do you have any suggestion?
You can see the error attached images.
If you want to run the FolioReaderKit Example project and you are new to Swift and Xcode I suggest you to use Cocoapods instead of Carthage. You don't have to run FolioReaderKit.xcodeproj.
Just go to Example folder and follow this steps:
Open the Terminal on Example folder;
Run pod install (you need Cocoapods installed);
Open Example.xcworkspace file on your Xcode and run;
To add this you your project using Cocoapods create a Podfile and add:
use_frameworks!
target 'MyApp' do
pod 'FolioReaderKit', '~> 0.7'
end
Then use pod install to install it to your project, the usage documentation is in the Example project.

Pods.framework in red, doesn't exist in DerivedData

I am trying to using Cocoapods 0.39.0 for the dependencies of my project. I have followed the steps, but I end up with a red Pods.framework in my project. If I look at the path where XCode 7.2.1 says it should be, it doesn't exist:
/Users/ajmas/Library/Developer/Xcode/DerivedData/myproject-cskuurnzjrcpcxfoyaceaeepshgt/Build/Products/Debug/Pods.framework
I have looked around at other entries in Stackoverflow, but I am not find anything indicating how the framework should be generated.
The contents of my Podfile are:
source 'https://github.com/CocoaPods/Specs.git'
target 'myproject' do
platform :osx, '10.11'
use_frameworks!
pod 'Alamofire', '~> 3.0'
end
Any ideas?
Edit, also tried with Cocoapods 1.0.0.beta and no change, even after updating the Podfile to confirm to 'target' being a requirement now.
Build your project with "Generic iOS Device" selected.
If this happens it's most likely because you are using <your_project>.xcproject. When you run pod install CocoaPods creates a <your_project.xcworkspace file that you need to use to have dependencies installed via CocoaPods be available when compiling.

Use of private header from outside its module error in CPTBorderedLayer.m of CorePlot

I upgraded to a new laptop with El Capitan, XCode 7.1, and Cocoapods 0.39.0. When I check out an existing project that uses the CorePlot framework, run pod install, and build the project, I get the following error messages in the CPTBorderedLayer.m file of CorePlot:
Use of private header from outside its module: '_CPTBorderLayer.h'
Use of private header from outside its module: '_CPTMaskLayer.h'
Below is a snippet of my podfile:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
target 'my_project' do
...
pod 'CorePlot', :git => 'https://github.com/core-plot/core-plot.git'
This project was compiling fine using Xcode 7.0 and cocoapods 0.37.2, but I'd really rather not downgrade everything unless there are no other options.
This error has something to do with the way CocoaPods sets up the framework project. A temporary fix is to remove the use_frameworks! line from the pod file to let it build the dependencies as a static library.
Please report the problem on the Core Plot issue tracker and we'll see if this can be fixed.

Using Realm Framework in Today extension (CocoaPods)

I am using realm.io as storage for some data. I want to share this data with my Today extension. I am using CocoaPods and I am wondering how I can share that Framework with both targets. My podfile looks like this:
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
pod 'MBProgressHUD'
pod 'Alamofire'
I tried with this and it worked when building to device, but not when building to the iOS simulator. It returned the error 'ld: framework not found Pods':
platform :ios, '8.0'
use_frameworks!
def shared_pods
pod 'RealmSwift'
pod 'Alamofire'
end
target 'App' do
shared_pods
pod 'MBProgressHUD'
end
target 'AppToday' do
shared_pods
end
What am I doing wrong?
Appreciate any help.
Brgds
Your Podfile looks correct and would work on a clean installation. But you found a bug in the user project integration in CocoaPods when migrating between different setups.
Background info
If you don't explicitly specify a target in the Podfile, then CocoaPods will integrate with the first target in your project. This was your app target, which worked correct as long as it was the only one.
But now you're referencing explicitly to the targets. CocoaPods will create separate so called aggregate targets. Those are in the Pods.xcodeproj and named Pods-App and Pods-AppToday. These are static framework targets (from 0.39.beta.5), which are weak linked to your targets to help Xcode finding your dependencies in the Pods project. Because CocoaPods doesn't know anything about the previous Podfile when you run pod install (and it doesn't retain this information in the Podfile.lock), it doesn't remove the old aggregate target, which was named just Pods and it's product reference in your app target.
Resolving the issue
Select your project file in Xcode in the file navigator
Select your app target in the left pane from the targets list
Go to the General tab
Remove Pods.framework from the Linked Frameworks and Libraries pane
Expected state before
How it should look like
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
pod 'MBProgressHUD'
pod 'Alamofire'
Add this line
link_with 'App', 'AppToday'

No such module when simulator, but when use device it can find it

I got a project where I use some Pods, where one of them is Meteor.
I have installed with cocoapods with this podfile
platform :ios, '8.0'
use_frameworks!
pod 'OpenTok', '~> 2.6'
pod 'Meteor', '~> 0.1'
And then open up the .xcworkspace instead of .xcodeproj
Then in my project I import Meteor in my AppDelegate.
When I choose a simulator and try to run/build it comes with the error "No such module 'Meteor'"
But then if I take my iPad and connect it and choose it as target, I can fine run/build.
I have not be able to find a solution for this yet.
I had the same symptom after following these instructions to speed up my build:
Prevent Xcode from building subprojects every time
I was able to run on a simulator again after reverting.
Product > Scheme > Edit Schemeā€¦
Build (in left column)
Make sure that "Find Implicit Dependencies" is Checked

Resources