Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap doesn't copy plugin files to ios platforms directory during build

Tags:

ios

cordova

rm -rf plugins/*
rm -rf platforms/*

phonegap build ios //this works

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

phonegap build ios

Building for ios after adding a plugin fails. Here is the error:

** BUILD FAILED **


The following build commands failed:
    CompileC build/PondMD.build/Debug-iphoneos/PondMD.build/Objects-normal/armv7/CDVDevice.o PondMD/Plugins/org.apache.cordova.device/CDVDevice.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
2014-01-16 10:32:15.055 xcodebuild[69605:1007] [MT] PluginLoading: Required plug-in compatibility UUID 37B30044-3B14-46BA-ABAA-F01000C27B63 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XCode4_beginning_of_line.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2014-01-16 10:32:16.630 xcodebuild[69605:4203]  DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:78
Details:  Failed to load dependencies output contents from ``/Users/william/working/PhonegapPondMD/platforms/ios/build/PondMD.build/Debug-iphonesimulator/PondMD.build/Objects-normal/i386/CDVDevice.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “CDVDevice.d” couldn’t be opened because there is no such file." UserInfo=0x7fe7a57a7440 {NSFilePath=/Users/william/working/PhonegapPondMD/platforms/ios/build/PondMD.build/Debug-iphonesimulator/PondMD.build/Objects-normal/i386/CDVDevice.d, NSUnderlyingError=0x7fe7a57aaed0 "The operation couldn’t be completed. No such file or directory"}. User info: {
    NSFilePath = "/Users/william/working/PhonegapPondMD/platforms/ios/build/PondMD.build/Debug-iphonesimulator/PondMD.build/Objects-normal/i386/CDVDevice.d";
    NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
}.
Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, F) [F = <lambda at /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:168:73>]
Thread:   <NSThread: 0x7fe7a57ab420>{name = (null), num = 7}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

The issue seems to be that phonegap is not copying the objective-c classes and headers into /platforms/ios/

william-macbook-pro:PhonegapPondMD william$ ls -l plugins/
total 8
-rw-r--r--   1 william  staff  296 Jan 16 10:32 ios.json
drwxr-xr-x  11 william  staff  374 Jan 16 10:30 org.apache.cordova.device

william-macbook-pro:PhonegapPondMD william$ ls -l platforms/ios/PondMD/Plugins/
total 8
-rw-r--r--  1 william  staff  890 Jan 16 10:30 README

william-macbook-pro:PhonegapPondMD william$ phonegap -v
3.3.0-0.18.0
like image 779
WSkinner Avatar asked Jan 16 '14 16:01

WSkinner


2 Answers

I had the same problem, and I solved It creating the project with uppercase in the first letter of project name. Yes, it seems incredible, but this was the solution.

like image 187
Carra Avatar answered Nov 16 '22 21:11

Carra


I ran into the same issue and solved it by using the instructions here: Cordova 3.2 ios add plugin "Which config.xml? Where is it?"

To summarize, I did the following steps:
1. Removed ios platform via: cordova platform remove ios
2. Re-installed the plugin
3. (Re-)Added the ios platform via: cordova platform add ios
4. Built the project again

After this, it built just fine.

like image 45
anothercoder Avatar answered Nov 16 '22 20:11

anothercoder