3

I have a swift project without cocoapods working with Parse SDK and Facebook SDK (for login and backend use).

When creating a Podfile to use GoogleMaps SDK (for places autocomplete suggestions) I get the following error: Use of unresolved identifier 'PFFacebookUtils'. The Podfile is the following:

source 'https://github.com/CocoaPods/Specs.git'
xcodeproj './PROJECT_NAME.xcodeproj'

platform :ios, '8.1'
pod 'GoogleMaps'

Parse & Facebook frameworks linked are included (everything worked before cocoapods created the workspace). Any ideas? Thanks!

UPDATE: I don't know if it makes any sense but if I use import ParseFacebookUtilsV4 in the files not recognizing PFFacebookUtils it recognizes it but now I get a linker error (apparently not finding any of Parse OBJC classes):

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_PFAnalytics"
       __TMaCSo11PFAnalytics in AppDelegate.o
  "_OBJC_CLASS_$_PFCloud", referenced from:
     ...
Fdo
  • 1,053
  • 4
  • 15
  • 38
  • As much as I hate to say it: deleting the `DerivedData` folder fixed my build issues after updating some Cocoapods. – Tim Oct 18 '19 at 18:43

3 Answers3

4

Install the pods again:

-pod install

After that do a check list:

  1. Library Search Paths. In my project Library Search Paths is empty. so I believe that cocoapods does not modify it. so remove old library links from there if any.

  2. Header Search Path

enter image description here

  1. Other Linker Flags. (remove old ones)

enter image description here

  1. Build Phases -> Link Binary With Libraries. (remove old ones)

enter image description here

Make sure that these are pointing to the new libraries in the Pod Project. and not the old ones.

My podfile to match with the setting associated to it:

target 'SomeName' do

pod 'RadioButton'
pod 'AFNetworking', '~> 2.5'
pod 'SSZipArchive', '~> 0.2.1'
pod 'SDWebImage', '~> 3.7'

end

target 'SomeNameTests' do

end

hasan
  • 23,815
  • 10
  • 63
  • 101
  • It didn't work but thanks for your suggestion :) . The only framework I stated in the Podfile was `GoogleMaps` and it still caused a problem for `Parse` framework, which was manually linked as a static library. I ended up removing cocoapods from my project completely and embedding the GoogleMaps framework manually after downloading it (from the entire podspecs here: https://github.com/CocoaPods/Specs) – Fdo Jul 28 '15 at 14:24
  • Good, but I hope that will not make you afraid of using cocoapods again in another projects. because, it is really helpful and save a lot of time and effort. – hasan Jul 28 '15 at 14:26
  • I do love cocoapods, the problem is when working on Swift projects that need compatibility with iOS 7.0+ because Swift doesn't support dynamic libraries for < 8.0 yet. I'm pretty sure everything should've worked smoothly a couple of days ago by using `use_frameworks!` in the Podfile, but it was not an option for this specific case :,( – Fdo Jul 28 '15 at 14:34
  • hi @hasan83, WHAT ARE YOU SAYING above about `header search paths` Should I remove them or what? thanks – Fattie Sep 25 '15 at 14:39
  • this answer was specifically for this specific question. if you want to use cocoapods keep them. if you want to stop the use of cocoa pods remove them – hasan Sep 25 '15 at 15:08
1

Have you import needed file in bridging header:

#import <Parse/Parse.h> 
#import <ParseFacebookUtils/PFFacebookUtils.h>
MobileGeek
  • 2,462
  • 1
  • 26
  • 46
  • Yeah, actually i have `#import #import ` – Fdo Jul 28 '15 at 06:24
  • I had them as linked libraries, and they were working... But now that cocoapods broke them I've added them in the Podfile and removed them as linked libraries, but XCode still doesn't recognize `PFFacebookUtils` :/ – Fdo Jul 28 '15 at 06:26
0

I did a clean then build and everything cleared up

FullMetalFist
  • 208
  • 1
  • 2
  • 14