I have a iOS project with a cocoa touch framework where I'd like to use CocoaPods. Everything runs and behaves correctly, as far as I can tell, but I'm getting the following warning for all the pods included (here with the example of MagicalRecord
.
objc[56961]: Class MagicalRecord is implemented in both /Users/stefan/Library/Developer/Xcode/DerivedData/FrameworkPlayground-ecdubsjzkmacfihjxoxvlznqvgmg/Build/Products/Debug-iphonesimulator/SharedDataSource.framework/SharedDataSource and /Users/stefan/Library/Developer/CoreSimulator/Devices/41B1BE94-1242-4538-8D60-23BAC3337308/data/Containers/Bundle/Application/B8ADA4E6-02BC-4095-8A14-D254C13D0928/FrameworkPlayground.app/FrameworkPlayground. One of the two will be used. Which one is undefined.
objc[56961]: Class PodsDummy_Pods_MagicalRecord is implemented in both /Users/stefan/Library/Developer/Xcode/DerivedData/FrameworkPlayground-ecdubsjzkmacfihjxoxvlznqvgmg/Build/Products/Debug-iphonesimulator/SharedDataSource.framework/SharedDataSource and /Users/stefan/Library/Developer/CoreSimulator/Devices/41B1BE94-1242-4538-8D60-23BAC3337308/data/Containers/Bundle/Application/B8ADA4E6-02BC-4095-8A14-D254C13D0928/FrameworkPlayground.app/FrameworkPlayground. One of the two will be used. Which one is undefined.
I uploaded the Xcode project to github, it's available here: https://github.com/haemi/FrameworkWithCocoaPods
Here two pictures from the current setup:
A shared framework in Cocoapods is refered to as a pod . Once we have captured our project targets and its requirements we have to tell Cocoapods to set up our project based on our project specification.
use_frameworks! in the Podfile means that we want the listed frameworks to be dynamically installed instead as static frameworks.
Change your pods file from:
target 'App' do
# all your pods
end
target 'AppTests' do
# all your pods
end
to:
target 'App' do
# all your pods
target 'AppTests' do
inherit! :search_paths
end
end
You must be opening your project with Xcode project but you should open your project with Xcode Workspace which is created by cocoa pods.
The project is not including the Pods file because of which those frameworks are not included and are shown in red Color.
Opening your project through workspace would resolve your issue.
Updated :
Just Delete MyHelper.h and MyHelper.m file.
Add new MyHelper class but this time change the target to FrameworkPlayground and put the same content which was there before and import #import into MyHelper.h file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With