0

Okej, I'm fighting against this for several hours now, and I'm completetly out of ideas. I'm creating app that has Action Extension needed for getting currently watched website URL. I need to share some code between app and extension (mainly network API), so I need to share libs for it also (alamofire etc.).

Here is my CocoaPods

use_frameworks!

target 'xxxExtension' do
pod 'ObjectMapper', '~> 2.2'
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
pod 'Nuke', '~> 4.0'
pod -
pod -
end

target 'yyyMain' do
pod 'ObjectMapper', '~> 2.2'
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
pod 'Nuke', '~> 4.0'
pod -
pod -
pod -
pod -
pod -
pod -
    target 'yyyMainTests' do
    inherit! :search_paths
    pod -
    pod -
    pod -
    pod -
    pod -
    end
end

As you can see I use implicit abstract target for use_frameworks, I've tried to move pods that are share there, but that didn't changed much. Created abstract_target myself, same error.

error: /Users/abc/Library/Developer/Xcode/DerivedData/yyyMain-fuuyjxathhqlfdczxrtmfewlpcpe/Build/Products/Debug-iphoneos/xxxExtension.appex: No such file or directory

Any ideas what's going on?

Kamajabu
  • 596
  • 1
  • 5
  • 19
  • have you tried to change project name xxxExtension to yyyMain. OR try removing first end to last – vaibby Jan 19 '17 at 13:00
  • don't understand how to change name xxxExtension to yyyMain? It's different module than yyyMain, how can they share same name? And moved the order few times already, didn't help. It's freaking weird, because in linked linked framework and libaries there is yyyExtension – Kamajabu Jan 19 '17 at 13:08

1 Answers1

0

Ok, that was a bit tricky and I've made few changes that may have resulted in solving the problem.

First was adding

    post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        if target.name.start_with? "Pods-extensionName"
            target.build_configurations.each do |config|
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'AF_APP_EXTENSIONS=1']
            end
        end
    end
end

To podfile.

Second one was (aside of all cleaning, rebuilding and deleting derived data) to manually remove binaries associations. To do so one needs to enter project settings -> targets -> app -> general -> (on bottom) Embedded Binaries and delete *.appex file.

Additional it may be required to go to build phases and remove link binary with Libaries.

Last thing to do is reinstall pod by "pod install" and new links should be recreated on cleaned project.

Goodluck!

Kamajabu
  • 596
  • 1
  • 5
  • 19