0

Currently, I am in the middle of migrating my iOS app from api.parse.com to my own server. In the guide I am following, I am at the point where I need to test the app's functionality with a local Parse Server. Although, setting up a custom Parse Server requires having the latest Parse-SDK, and I am running an older version. I am trying to update my frameworks via CocoaPods. My Podfile is as follows:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'MYAPP' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MYAPP
  pod 'ParseFacebookUtilsV4'
  pod 'Parse'
  #pod 'ParseTwitterUtils'
  pod 'ParseCrashReporting'
  pod 'ParseUI'

  target 'MYAPPTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

When I try running the app, I get the following error:

duplicate symbol _PFConfigParametersRESTKey in:
    /Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFConfig.o)
    /Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFConfigController.o)
duplicate symbol _PFConfigParametersRESTKey in:
    /Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFConfig.o)
    /Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFCurrentConfigController.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've been searching for something online to help, but nobody seems to be experiencing this problem. I think my case is unique, as I have yet to see someone who has two duplicate errors on the same symbol pointing to the same archive(libParse.a) with one shared file (PFConfig.o) and two differing ones (PFConfigController.o and PFCurrentConfigController.o). I've implemented a variety of solutions that would generally solve this "duplicate symbol" error, but I haven't had any success.

Things I have done:

  1. Ensured that all manually added versions of these frameworks have been removed from the project.

  2. Scanned the project directory up and down multiple times via Finder/Command Line/grep/find and could not find any duplicated frameworks.

  3. Ensured I did not add any "import *.m" files accidentally.

  4. Checked for red files/duplicates in the Frameworks folder as well as the "Link Library With Libraries" section of "Build Phases."

  5. Checked my framework, header, and other linker paths and they seem to be alright. My "Other Linker Flags" contains "$(inherited)" and a -force_load call to a third party ".a" file for analytics.

  6. Cleared ~/Library/Developer/Xcode/DerivedData as well as removed Pods/ and ran "pod install" multiple times.

I went on to investigate the problem in the Parse files. The only place where PFConfigParametersRESTKey is defined is here and here. This seems alright since one of them is preceded by the extern keyword(reference here). I tried messing with the source files a little bit by making this variable not static and also trying to rename one of them. Nothing worked. I cannot figure out where to look to fix this.. If anybody can shed some light here I would greatly appreciate it! Thank you.

Community
  • 1
  • 1
jon
  • 1

1 Answers1

0

The solution to my problem was to remove an -ObjC flag from the linker config. For some reason, -ObjC was not one of the entries in the Linking section of Build Settings. The way I found it was by going to Pods/Pods-MYAPP.debug.xcconfig, and manually removing the -ObjC flag from the OTHER_LDFLAGS variable.

jon
  • 1