Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libCordova.a file missing in PhoneGap 2.9

Can you plz help me? I am using XCode version 4.6.3 and phonegap version 2.9. The project is running fine in Simulator but when I want to make a IPA file, it always build failed.

The message is showing like below:

file not found: /Users/admin/.../libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have found some discussion on this issue. Most of the solution is like (1) to change the BUILD ACTIVE ARCHITECTURE ONLY to YES, (2) to change the ARCHITECTURE only to armv7, (3) update the project after creating it...etc. But none of those working for me.

Plz help anyway.

Thanks in advance.

like image 319
Mehdi Avatar asked Jul 01 '13 09:07

Mehdi


3 Answers

Follow these steps to fix this problem:

  1. Go to project settings and Build Tab. Search for "Other Linker Flags"
  2. Double click on the linker flags for Release and Change ${TARGET_BUILD_DIR}/libCordova.a to ${BUILT_PRODUCTS_DIR}/libCordova.a
  3. Do the same for Debug
  4. Clean and build archive again
like image 94
Prem Avatar answered Nov 17 '22 17:11

Prem


If Prems answer doesn't fix the issue, try building your CordovaLib project first. After doing that I was able to build my project.

like image 1
Chris Avatar answered Nov 17 '22 18:11

Chris


In addition to several other suggestions & post, I found that I was experiencing this problem on my AdHoc builds only.

The problem for me was the the CordovaLib subproject did not have an AdHoc configuration. Once I added an "AdHoc" configuration to the CordovaLib subproject, this started working.

enter image description here

Please note that I figured this out during debugging because if I set the Edit Scheme > Archive build configuration to "release" it would work OK, but if set to AdHoc it would give me a link error, telling me that this file could not be found:

/Users/jason/Library/Developer/Xcode/DerivedData/MommyNearest-ceourmykvgxdekbkmzenuvhcfnzk/Build/Intermediates/ArchiveIntermediates/MommyNearest/BuildProductsPath/Adhoc-iphoneos/libCordova.a

like image 1
Jason FB Avatar answered Nov 17 '22 16:11

Jason FB