1

I have a podfile with only Objective-C pods, that looks like this:

source 'https://github.com/CocoaPods/Specs.git'
target "myProject" do
    pod 'GoogleMaps'
    pod 'GooglePlaces'
    pod 'GooglePlacePicker'
    pod 'GoogleMaps'
    pod 'RMMapper'
    pod 'Parse'
    pod 'Mapbox-iOS-SDK'
    pod 'PocketSVG', '~> 0.7'
    pod 'Fabric'
    pod 'Answers'
    pod 'lottie-ios'
end
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end

and a bridiging header that looks like this:

#import <Parse/Parse.h>
#import <GoogleMaps/GoogleMaps.h>
#import "PocketSVG.h"
#import <Lottie/Lottie.h>

Now, I want to add Alamofire, which is a Swift pod. So I have to use use_frameworks!, and my podfile looks like this:

source 'https://github.com/CocoaPods/Specs.git'
target "myProject" do
    pod 'GoogleMaps'
    pod 'GooglePlaces'
    pod 'GooglePlacePicker'
    pod 'GoogleMaps'
    pod 'RMMapper'
    pod 'Parse'
    pod 'Mapbox-iOS-SDK'
    pod 'PocketSVG', '~> 0.7'
    pod 'Fabric'
    pod 'Answers'
    pod 'lottie-ios'
    pod 'Alamofire'    # Added
    use_frameworks!    # Added
end
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end

but when I'm trying to build my project, I get 2 errors:

The first is on my bridging header:

'PocketSVG.h' file not found

The second is not on a specific file:

Failed to import bridging header

Any idea how can I fix it?

jscs
  • 63,694
  • 13
  • 151
  • 195
FS.O6
  • 1,394
  • 2
  • 20
  • 42

2 Answers2

1

use_framework will make the libs specified in the pod file linked as dynamic libraries. You should use #import <PocketSVG/PocketSVG.h> or @import PocketSVG;

leavez
  • 2,119
  • 2
  • 27
  • 36
-1

Try like this

  1. open podfile with command -> open podfile

and put the below text in that podfile

target 'Myproject' do
 platform :ios, '10.0'
 use_frameworks!
 pod 'GoogleMaps'
 pod 'GooglePlaces'
 pod 'GooglePlacePicker'
 pod 'GoogleMaps'
 pod 'RMMapper'
 pod 'Parse'
 pod 'Mapbox-iOS-SDK'
 pod 'PocketSVG', '~> 0.7'
 pod 'Fabric'
 pod 'Answers'
 pod 'lottie-ios'
 pod 'Alamofire' 
end

No need to add extra lines after that just type command pod install I hope it will work!

Bhupat Bheda
  • 1,968
  • 1
  • 8
  • 13