Imodeveloper
Imodeveloper

Reputation: 93

How to link an framework generated by Cocoapods in a new iOS8 framework target

I'm trying to create an iOS framework which I can use in many other iOS projects, and this framework has some dependencies, I need to use AFNetworking and Mantle libraries, I have created new project and podfile containing

platform :ios, '8.0'
use_frameworks!

pod 'Mantle', '~> 2.0'
pod 'AFNetworking', '~> 2.5'

and I run pod install, after cocoapods generate an workspace, after that I add new target to my project which is iOS8 framework, in this framework settings "General/Linked Frameworks and Libraries click + butotn and select AFNetworking and Done, after i'm trying to build my project but I get this Error

ld: warning: directory not found for option '-F/Users/borinschiivan/Desktop/ImodeveloperSDK/build/Debug-iphoneos/Pods' ld: framework not found AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)

You can download this test project here.

Upvotes: 1

Views: 2647

Answers (2)

nprd
nprd

Reputation: 1942

You need not do this step " in this framework settings in this framework settings, General/Linked Frameworks and Libraries click + button and select AFNetworking and Done"

All the linking would be done automatically by cocoa pods.

Note: Since you are building a library, read pod spec for creating reusable component. you can create your ImodeveloperKit as pod framework and specify AFNetowrking as a dependency for your framework in cocoa pod specification.

Edit: using link_with and specifying all the target solved the issue

Upvotes: 1

Allen
Allen

Reputation: 196

platform :ios, '8.0'
pod "AFNetworking", "~> 2.5"

Upvotes: 0

Related Questions