如何解决Cordova插件的Mach-O Linker错误

时间:2014-10-25 19:32:16

标签: ios xcode cordova plugins linker

我在我的mac上安装了最新的cordova 4.0版,并使用的是Xcode 6.0.1

我可以运行基本的cordova应用程序,但是当我尝试使用插件https://github.com/hazemhagrass/ContactPicker时,它的构建失败了。它显示了丢弃的警告,同时抛出了Mach-O Linker错误

错误日志如下

/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:11:33: Assigning to 'id<ABPeoplePickerNavigationControllerDelegate>' from incompatible type 'ContactChooser *const __strong'
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:12:26: 'presentModalViewController:animated:' is deprecated: first deprecated in iOS 6.0
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:293:1: 'presentModalViewController:animated:' has been explicitly marked deprecated here
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:40:116: 'toSuccessCallbackString:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/CordovaLib/Classes/CDVPluginResult.h:67:1: 'toSuccessCallbackString:' has been explicitly marked deprecated here
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:40:16: 'writeJavascript:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate equivalent of evalJs:. This will be removed in 4.0.0
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/CordovaLib/Classes/CDVPlugin.h:61:1: 'writeJavascript:' has been explicitly marked deprecated here
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:41:30: 'dismissModalViewControllerAnimated:' is deprecated: first deprecated in iOS 6.0
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:296:1: 'dismissModalViewControllerAnimated:' has been explicitly marked deprecated here
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:23:21: Implicit conversion loses integer precision: 'CFIndex' (aka 'long') to 'int'
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:53:26: 'dismissModalViewControllerAnimated:' is deprecated: first deprecated in iOS 6.0
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:296:1: 'dismissModalViewControllerAnimated:' has been explicitly marked deprecated here
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:56:45: 'toErrorCallbackString:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/CordovaLib/Classes/CDVPluginResult.h:69:1: 'toErrorCallbackString:' has been explicitly marked deprecated here
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/TeleVoIPsDialer/Plugins/ContactChooser.m:54:12: 'writeJavascript:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate equivalent of evalJs:. This will be removed in 4.0.0
/Users/joelasirvathamjesudoss/Documents/iOS Dialer App/TeleVoIPsDialer/platforms/ios/CordovaLib/Classes/CDVPlugin.h:61:1: 'writeJavascript:' has been explicitly marked deprecated here
  "_ABMultiValueCopyValueAtIndex", referenced from:

  "_ABMultiValueGetCount", referenced from:

  "_ABMultiValueGetIdentifierAtIndex", referenced from:

  "_ABMultiValueGetIndexForIdentifier", referenced from:

  "_ABRecordCopyCompositeName", referenced from:

  "_ABRecordCopyValue", referenced from:

  "_OBJC_CLASS_$_ABPeoplePickerNavigationController", referenced from:

  "_kABPersonEmailProperty", referenced from:

  "_kABPersonPhoneProperty", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:0)

我降级到Phonegap 2.8.0并且错误消失了,但是我收到很多警告(警告显示即使我只使用手机间隙2.8.0运行hello world应用程序)。

至于插件本身,它调用了iOS Contacts App,但是当我选择一个名称时,它会进入详细信息页面,但控件不会返回到联系人应用程序,也不会返回到我选择的联系人的信息。 / p>