19

I am trying to run an ionic app on xcode. But xcode throws an apple match-o linker error. I get this error, when I get this after I have runned the following command:

cordova plugin add phonegap-plugin-push --variable SENDER_ID=5****** --save

I need this plugin, for push notifications. After a research on google, I founded that I need to have Cocoapods installed in the projects. But after installing Cocoapods & pod install. I get the following error, when I start the "project.xcworkspace".

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

I tried to rebuild/clean project or install pod again. But it did not fixed for me.

Can someone help me?

EDIT -> new Error

Apple Mach-O Linker (ld) Error Group

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

I am getting this error, when i have fixed the error with pods.

Community
  • 1
  • 1
TheJokerAEZ
  • 361
  • 1
  • 3
  • 9

8 Answers8

25

If you are setting up environment setup in your project, you have to choose corresponding pods target in configuration.

enter image description here

anas.p
  • 2,246
  • 19
  • 26
8

Update your CocoaPods installation first ("sudo gem install cocoapods") then remove everything related to POD from project directory except .podfile. Run "pod install" on terminal and open your project using workspace file.

Venu Gopal Tewari
  • 5,672
  • 42
  • 41
7

1- Remove PODS folder from project folder and then perform pod install and open project using .xcworkspace file.

If above one don't work, go to Xcode Build phase and check for path in scripts added by PODS(usually with pods word in there title), sometimes for hybrid project the path was not correct for podfile.lock and manifest.lock file lookup in the script.

Joe
  • 3,774
  • 1
  • 17
  • 25
  • I tried the both options. Just getting the same error. Cleaning the project and rebuilding doesn't work too. Any solutions? the other solutions on stack also not working:( – TheJokerAEZ May 04 '17 at 19:02
1

Easiest Solution which worked for me:

  1. Open terminal inside your project directory
  2. Change directory to 'ios' (cd ios)
  3. Type 'pod install' and wait for dependencies getting downloaded and installed

I hope this will help someone out!

Praful
  • 19
  • 5
1

In my case, I updated cocoapods and the problem was solved.

gem install cocoapods --user-install

iOS
  • 3,526
  • 3
  • 37
  • 82
1

My case, Please:

  1. Xcode → File → Workspace Settings.

  2. Make sure in tag: Build System → New Build System.

  3. Please copy your Podfile.

  4. Delete Podfile, Podfile.lock, Pods Folder in your root app folder, like this.

  5. Next Step, Open <YourProject>.xcodeproj. You should use Terminal by: open <YourProject>.xcodeproj. (Remember not .xcworkspace)

  6. In Pods tag, delete these files, like this:

    • <Pods-YOURPROJECT>.debug.xcconfig
    • <Pods-YOURPROJECT>.release.xcconfig
  7. Pod init and Pod install your Project again.

  8. Open <YOUR PROJECT>.xcworkspace, with Terminal: open YOURPROJECT.xcodeproj

  9. CMD+SHIFT+K to clean build.

  10. CMD+B to build again.

  11. Enjoy

ordonezalex
  • 2,645
  • 1
  • 20
  • 33
Lee Toan
  • 46
  • 1
  • 4
0

Last year I had used the similar plugin, when I was working on an App Update, I came to know that this plugin got deprecated. Not sure about the above one.

So I've working using FCM. I had the similar problem while working with FCM. After having spent nearly a day on researching on this I've found a cordova plugin which takes care of pods in cordova.

Plugin name:

cordova plugin add cordova-plugin-cocoapod-support --save

Please Note: After installing this plugin, there's no need of podinit, or opening the pod and installing it. This plugin will take care of it. It will create a AppDelegate inside the plugin folder where it will handle everything - you can retrieve Push Token as well in DEV mode if you wish.

After I installed this plugin and build iOS, there were no issues.

** Note ** Please ensure while working with FCM, no other google plugins are installed, they'll conflict. Earlier I had GoogleAnalytics plugin, as it's now covers within FCM - you can remove Old GoogleAnalytics plugin in order to work with FCM without issues.

Santosh
  • 581
  • 7
  • 17
0

For my Cordova project doing pod init in the ios folder fixed the issue.

From your Cordova project root directory you would:

cd /platforms/ios
pod init
cd ../../
cordova build ios
Paul Schorey
  • 862
  • 10
  • 14