Cocoapods: incorrect path for a framework in a multi-platform project

Created on 19 Jun 2017  路  4Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

I have a multi-platform project: it was first created as an iOS app, but then a Mac app target was added too. The Podfile specifies some pods to be included on both platforms.

When I run pod install, CocoaPods sets up the Pods project and integrates it with the main one, adding a bunch of .framework entries. However, after I build both versions of the app, I can see that one of the .framework entries is still shown in red. After examining its path, I can see that it's referencing a pods framework for the Mac app in the iOS build folder.

In the Pods project under Products I can see two .framework entries:

  • Pods_FooApp.framework -> Build/Products/Debug-iphoneos/Pods_FooApp.framework (iOS build folder)
  • Pods_FooAppMac.framework -> Build/Products/Debug/Pods_FooAppMac.framework (Mac build folder)

However, in the FooApp project under Frameworks I can see the same two entries repeated again, but one of them seems to have an incorrect path:

  • Pods_FooApp.framework -> Build/Products/Debug-iphoneos/Pods_FooApp.framework (iOS build folder)
  • Pods_FooAppMac.framework -> Build/Products/Debug-iphoneos/Pods_FooAppMac.framework (iOS build folder again!)

And the last one is shown in red, since the Mac framework obviously doesn't exist in the iOS build folder even after I build both apps.

Am I doing something wrong with the Podfile, or am I setting up the Xcode project incorrectly, or is this some kind of bug?

What did you expect to happen?

After I build both the iOS and the Mac app, I would expect all product and intermediate files to exist and be shown in black in the file inspector.

What happened instead?

One of the files is shown in red in the file inspector, since it doesn't exist at the path the entry is linking to.

screen shot 2017-06-19 at 01 39 58

CocoaPods Environment

Stack

   CocoaPods : 1.2.1
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
    RubyGems : 2.6.8
        Host : Mac OS X 10.12.5 (16F73)
       Xcode : 8.2.1 (8C1002)
         Git : git version 2.10.1 (Apple Git-78)
Ruby lib dir : /Users/kuba/.rvm/rubies/ruby-2.3.3/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 392a9b743a2204a0c2c0ac4c8c72d72901c0c27d

Installation Source

Executable Path: /Users/kuba/.rvm/gems/ruby-2.3.3/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.2.0
cocoapods-try         : 1.1.0

Podfile

target 'FooApp' do
  platform :ios, '10.0'
  use_frameworks!

  pod 'CocoaLumberjack'
end

target 'FooAppMac' do
  platform :osx, '10.12'
  use_frameworks!

  pod 'CocoaLumberjack'
end

Project that demonstrates the issue

https://www.dropbox.com/s/ia3nkwlfruz78fj/FooApp.zip?dl=0

awaiting input

Most helpful comment

Do a pod deintegrate when adding platforms or removing to/from a Podfile.

CocoaPods names targets in multi-platform workspaces differently than single platform workspaces. This results in inconsistencies when converting between them.

All 4 comments

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

Same Issue here... Banging my head against the table wondering why I'm get 'framework not found' and realized the pod dependencies of the host app's frameworks are being built inside the build folder and not inside any of my targets

Do a pod deintegrate when adding platforms or removing to/from a Podfile.

CocoaPods names targets in multi-platform workspaces differently than single platform workspaces. This results in inconsistencies when converting between them.

Was this page helpful?
0 / 5 - 0 ratings