Xcode 4.5 no such file or directory - libCordova.a

后端 未结 12 804
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 21:21

clang: error: no such file or directory: \'/Users/admin/Library/Developer/Xcode/DerivedData/__TESTING__-fzbkvdbnndieeagphtjhdndiyttl/Build/Products/Debug-iphoneos/li

相关标签:
12条回答
  • 2020-12-30 21:44

    In addition to several other suggestions & post, I found that I was experiencing this problem on my AdHoc builds only. 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

    This was actually a good clue to what the problem was, which was that somehow the CordovaLib subproject did not have an AdHoc configuration (it had ONLY "Debug" and "Release" configurations).

    Therefore, when building for an AdHoc release (to use with Testflight) it would not create a symlink for this file correctly. Once I added an "AdHoc" configuration to the CordovaLib subproject, this started working.

    enter image description here

    0 讨论(0)
  • 2020-12-30 21:49

    Had (as many others) the same problem, here's what I did:

    1. Redid the Getting Started guide from Phonegap (including downloading and extracting the source again)
    2. Same problem with the HelloWorld app
    3. product - clean
    4. Changed both the 'HelloWorld' and 'CordovaLib'-project (so not the Targets) according to james0n's answer, settings:

    Architectures: Standard (armv7, armv7s)

    Build Active Architecture only: Yes

    and then it magically worked, I think steps 3 and 4 did it however.

    0 讨论(0)
  • 2020-12-30 21:49

    After spending many hours with even more errors, here's what worked for me. Basically combining much of the above:

    1. Start with a fresh copy of Cordova. If you've been messing with it like me, it's not fresh anymore.
    2. Move the Cordova files out of the download directory (I tend to clean that directory now and then...)
    3. Create a new project as described in the Phonegap docs, i.e. drag the ios/bin folder to the Terminal icon and run the create script in Terminal. No need to run the update_cordova_subproject script.
    4. Open the project in XCode.
    5. For your product, set the iOS Deployment Target to 4.3 (I did it 2x, both in Project and Target Build Settings).
    6. For CordovaLib.xcodeproj, set Build for Active Architecture to Yes in the Project Build Settings.
    7. Clean and run.

    Do not include armv7s in any of the architecture lists, as it will not build for device.

    Tested in simulator and on an iPad with iOS 6. Using Phonegap 2.1.0 and XCode 4.5.1.

    Update: if you want to support iPhone 5, you will need armv7s. It requires the fix in https://issues.apache.org/jira/browse/CB-1360 , which will be in Cordova 2.2.0. (Haven't tried it yet, working on an iPad project.)

    0 讨论(0)
  • 2020-12-30 21:51

    Also - make sure you don't have more than one PhoneGap Xcode project open at a time - I was getting conflicts between the two. "Workspace already open in another workspace" type of loop.

    0 讨论(0)
  • 2020-12-30 21:53

    I had this problem too. I think it was because I had previously installed an old version of phone gap that installed some stuff in xcode. I uninstalled, then reinstalled xcode. Then I ran the Uninstall Cordova.applescript that came with phone gap. This fixed the problem of the red libCordova.a

    0 讨论(0)
  • 2020-12-30 21:54

    You gotta run the update script, I know it might be a pain in the butt to do it, but that's what it takes.

    Download and open the Phonegap 2.1 package from the official site. Open a terminal window, and cd to the installation directory

    You'll need to first create a new project:

    ./create [project_folder_path] [package_name] [project_name]

    Then you need to set the path to your libraries.

    /update_cordova_subproject [xcodeproj file]

    Now open up your project and set the deployment target to 4.3 and you should be ready to go. Hope that helps

    EDIT:

    This is how my configuration looks like for CordovaLib Project

    enter image description here

    0 讨论(0)
提交回复
热议问题