Pod should be usable inside the framework, app should not crash.
Pod can be used inside the framework, but the app crashes immediately after launch with the following message (EXC_BREAKPOINT)
dyld: Library not loaded: @rpath/RandomKit.framework/RandomKit
Referenced from: [some path]/Build/Products/Debug-iphonesimulator/PodsTestFramework.framework/PodsTestFramework
Reason: image not found
Please see my demo project.
CocoaPods : 1.0.0
Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
RubyGems : 2.0.14.1
Host : Mac OS X 10.11.4 (15E65)
Xcode : 7.3.1 (7D1014)
Git : git version 2.7.4 (Apple Git-66)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 44dde03a3843e26e66eb37bf453a7a95879dce38
Executable Path: /usr/local/bin/pod
cocoapods-deintegrate : 1.0.0
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.0.0
cocoapods-try : 1.0.0
use_frameworks!
target 'PodsTestFramework' do
platform :ios, '8.0'
pod 'RandomKit'
end
Integrating into frameworks is currently unsupported.
Oh, didn't know that... Is there a roadmap for that feature?
No, it's not on our upcoming roadmap, though we should add a warning as soon as possible that this doesn't happen in the build process
Too bad :(
I think that would be helpful, maybe a warning/error during install/update process.
I will close this issue.
By the way, can I put this somehow on a feature request list? ;)
@tfonfara a PR adding a warning would be a great start ;)
@segiddins I'd love to contribute, unfortunately I'm not familiar with ruby :(
I run into the same issue it usued to worked before right?
Update: I found a way to integrate Cocoapods with frameworks. The only thing we have to do is to link the pods we use in the framework target also in the app target that embeds the framework:
use_frameworks!
target 'PodsTestApp' do
platform :ios, '8.0'
pod 'RandomKit'
end
target 'PodsTestFramework' do
platform :ios, '8.0'
pod 'RandomKit'
end
This was added in 1.1.x - BTW you could make that Podfile:
use_frameworks!
abstract_target 'My Pods' do
platform :ios, '8.0'
target 'PodsTestApp'
target 'PodsTestFramework'
pod 'RandomKit'
end
Currently I use that style which one is the "preferred one"?
use_frameworks!
def framework_pods
pod 'RandomKit'
end
target 'PodsTestApp' do
platform :ios, '8.0'
framework_pods
pod 'WhateverPod'
end
target 'PodsTestFramework' do
platform :ios, '8.0'
framework_pods
end
There is no preferred one, both work fine 馃憤 - https://github.com/CocoaPods/CocoaPods/issues/6256#issuecomment-264097242 has an example similar
Tkx! 馃憤
This was helpful. Thanks.
I didn't understand how you solve it, it was not meant to be clear.