0

I'd like to use some libraries in both main app and its extension. I tried this podfile

platform :ios, '10.2'
use_frameworks!
target 'myApp' do
       target 'myAppShareExtension' do
                pod 'SVProgressHUD', :git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'
                pod 'Alamofire', '~> 4.0'
                pod 'FileKit', '~> 4.0.1'
       end
end

But my Targets Support Files is named Pods-myApp-myAppShareExtension while it should be Pods-myAppShareExtension which makes me think the problem comes from the podfile.

Thanks.

radar
  • 500
  • 1
  • 6
  • 24

1 Answers1

0

You can try this:

The best way to share the pods for multiple targets:

def shared_pods
            pod 'SVProgressHUD', :git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'
            pod 'Alamofire', '~> 4.0'
            pod 'FileKit', '~> 4.0.1'

end

target 'myApp' do
    shared_pods
end

target 'myAppShareExtension' do
    shared_pods
end
Imad Ali
  • 3,261
  • 1
  • 25
  • 33
  • Thanks. But it exits with `The 'Pods-myapp' target has frameworks with conflicting names: alamofire, filekit, and svprogresshud.` – radar May 03 '17 at 08:10
  • Please remove the Pods from your project, create new pod file and install pods. To delete pods from your project see this: http://stackoverflow.com/questions/16427421/how-to-remove-cocoapods-from-a-project – Imad Ali May 03 '17 at 08:13
  • Did it but same problem. I'm wondering if that's not related to a bug of cocoapods 1.2 [here](https://github.com/CocoaPods/CocoaPods/issues/6480). – radar May 03 '17 at 08:35
  • Please look at this one, referred to on GitHub too : http://stackoverflow.com/questions/42114122/using-cocoapods-in-an-app-extension-using-a-framework – Jonas Zaugg May 03 '17 at 08:46