Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing dependency target "CordovaLib (from CordovaLib.xcodeproj)"

Missing dependency target "CordovaLib (from CordovaLib.xcodeproj)" When running ios with Xcode

enter image description here

like image 454
Chawki Messaoudi Avatar asked Oct 13 '16 13:10

Chawki Messaoudi


3 Answers

A different solution

Before reading this MAKE SURE you are opening YourProject.xcworkspace and NOT YourProject.xcodeproj

I couldn't get this to work using @manzapanza 's solution

The Problem

CordovaLib.xcodeproj is missing from your xcode project

Solution (for mac users)

Download a copy of CordovaLib.xcodeproj and drag it into your xcode project.

  • $ sudo npm install -g cordova (installs a "global" copy of cordova to your computer, you might be able to skip this step)
  • $ find ~/ -name 'CordovaLib.xcodeproj' (mine was at /Users/Jackson//.cordova/lib/npm_cache/cordova-ios/4.3.1/package/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/CordovaLib.xcodeproj)
  • Open folder the folder path found above $ open [path] (open /Users/Jackson//.cordova/lib/npm_cache/cordova-ios/4.3.1/package/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/)
  • Drag CordovaLib.xcodeproj to your xcode project

This is what your file navigator should look like at this point:

xcode example

  • Delete red (missing) file
  • Select your app in the navigator (very top of file tree). Go to Targets > [Your Project Name] > Build Phases > Link Binary With Libraries > "+"
  • type in / look for libCordova.a and add it
  • Compile project
like image 106
Jacksonkr Avatar answered Nov 14 '22 06:11

Jacksonkr


For some reasons the xcode project was corrupted. Generally, to solve this kind of problems, you can try removing and re-adding the platform ios:

ionic platform rm ios
ionic platform add ios
ionic build ios

Attention: Any changes that you applied directly from xcode will be lost and you will need to apply manually after you will have run these commands. Do a backup of platforms/ios before.

like image 20
manzapanza Avatar answered Nov 14 '22 06:11

manzapanza


Same solution for Apache Cordova project.

Remove platform and re-add:

cordova platform remove ios  
cordova platform add ios  
cordova prepare ios    
cordova run ios 

Successful!

like image 4
BernaAsis Avatar answered Nov 14 '22 07:11

BernaAsis