Phonegap在构建期间不会将插件文件复制到ios平台目录

WSk*_*ner 8 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
Run Code Online (Sandbox Code Playgroud)

添加插件后为ios构建失败.这是错误:

** 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.
Run Code Online (Sandbox Code Playgroud)

问题似乎是phonegap没有将objective-c类和头文件复制到/ 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
Run Code Online (Sandbox Code Playgroud)

Car*_*rra 21

我有同样的问题,我解决了它在项目名称的第一个字母中用大写创建项目.是的,这似乎令人难以置信,但这是解决方案.

  • 这是我用过的最荒谬的答案!这绝对是应该在文档中的内容. (9认同)
  • 这应该被认为是Phonegap的一个错误 (3认同)
  • 这仍然是2014年11月底的一个问题 (3认同)
  • 一个严重的错误!谢谢@Carra (2认同)

ano*_*der 13

我遇到了同样的问题并通过使用这里的说明解决了它:Cordova 3.2 ios添加插件"哪个config.xml?它在哪里?"

总结一下,我做了以下步骤:
1.通过以下方法删除ios平台:cordova平台删除ios
2.重新安装插件
3.(重新)通过以下方式添加ios平台:cordova platform add ios
4.再次构建项目

在此之后,它建立得很好.

  • 更奇怪的是,在添加任意数量的插件之后,您需要做的就是删除并重新添加您的平台.`cordova平台rm android ios && cordova平台添加android ios && cordova build`每次添加新插件时都适合我. (3认同)