18

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:

enter image description here

enter image description here

5
  • Your github repo is missing Podfile, which I assume is necessary for reproducing the issue.
    – Jakub Vano
    Mar 26, 2015 at 8:02
  • ouch, sorry - stupid mistake. Solved that, everything should be in the repo now.
    – swalkner
    Mar 26, 2015 at 8:05
  • As @Dheeraj says, are you opening the xcworkspace? I downloaded your project and builds just fine
    – wolffan
    Mar 30, 2015 at 8:36
  • it builds fine - but when running, I get those warnings... don't you get warnings when running the app?
    – swalkner
    Mar 30, 2015 at 8:42
  • @swalkner were you able to find solution of this issue?
    – Rajkumar
    Aug 11, 2015 at 8:52

4 Answers 4

4

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
1
+50

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 :

  1. Just change the Setting to remove the error that used to come :

enter image description here

  1. Change the Setting to :

enter image description here

  1. It would resolve the previous error but it would generate new errors of PODS to remove the error just remove Check Pods manifest.lock and copy pods resources.

enter image description here

  1. Just Delete MyHelper.h and MyHelper.m file.

  2. 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.

enter image description here

5
  • At my end i tried your code from xcode proj ,got same error as yours. But when opened through workspace no error is shown and build is successful. Mar 30, 2015 at 8:44
  • 1
    do you get any warnings when running the app?
    – swalkner
    Mar 30, 2015 at 9:17
  • yes, i got it. what are you trying with "SharedDataSource" can u tell ? Mar 30, 2015 at 9:21
  • 1
    in my real project I'm using WatchKit and need to have Core Data; to have access to my data storage in one place, I'm using app groups together with the framework (= SharedDataSource)
    – swalkner
    Mar 30, 2015 at 11:10
  • Let us continue this discussion in chat. Mar 30, 2015 at 11:41
1

Had the same issue. Solved it by deleting the derived data for my project. Go to Window -> Projects, select your project, and then click the "Delete" button to the right of the Derived Data section. Go back to your Xcode window and clean the build folder using command+option+shift+k. Then go to your simulator, iOS Simulator -> Reset Content and Settings. Return to your Xcode window, build your project and run. This only works for those having issued with derived data.

0

First followed this answer to purge my derived data but when recompiling I got a compilation error. Eventually ended up getting the fix from this answer. Basically, the culprit seems to be that the Pods are linked twice under Other Linker flags in your project's settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.