Sunday, March 10, 2019

Undefined symbols for architecture x86_64


Hello All,

I am getting below error when I try to run the project in Xcode -


Undefined symbols for architecture x86_64:

  "_OBJC_CLASS_$_SKStoreProductViewController", referenced from:

      objc-class-ref in CDVAppRate.o

  "_SKStoreProductParameterITunesItemIdentifier", referenced from:

      ___29-[CDVAppRate launchAppStore:]_block_invoke in CDVAppRate.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)



I have found the solution for this error. The solution is very simple, You need to add the StoreKit framework. To add this follow below steps -


1. Clicking on your project in the upper left of the left pane and select project from TARGETS -



2. In the middle pane you can see the "Build Phases" section, Now click on the Build Phases tab.

3. After this under "Link Binary With Libraries", click on the plus button.



4. Now search for "StoreKit" and find the StoreKit from the list and press Add button.



Now run the project again and the project will get run successfully. This works for me if you are still facing any issue please post your error in the comment section. I will try to resolve this issue.

Note - In my case this issue I faced in ionic / Cordova projects. But this is a common issue related to Xcode.   

2 comments: