gpt4 book ai didi

ios - 无法构建或编译phonegap 2.1

转载 作者:行者123 更新时间:2023-11-29 04:21:42 25 4
gpt4 key购买 nike

系统信息。Xcode:4.3.3OSX:10.7.4

我已经下载了phonegap 2.1(incubator-cordova-ios)。我已使用文档中提到的命令行代码成功创建了项目。

$ ./path/to/cordova-ios/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName

我使用如下代码来构建我的项目。 $/path/to/my_new_cordova_project/cordova/debug

当我尝试调试时,出现以下错误

/Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:252:14: error: use of undeclared identifier 'ABAddressBookCreateWithOptions' [3] if (&ABAddressBookCreateWithOptions != NULL) { ^ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:253:24: warning: implicit declaration of function 'ABAddressBookCreateWithOptions' is invalid in C99 [-Wimplicit-function-declaration,3] addrBook = ABAddressBookCreateWithOptions(NULL, NULL); ^ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:253:22:{253:24-253:66}: warning: incompatible integer to pointer conversion assigning to 'ABAddressBookRef' (aka 'const void *') from 'int' [3] addrBook = ABAddressBookCreateWithOptions(NULL, NULL); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:326:96:{326:96-326:139}{326:109-326:139}: error: cast of Objective-C pointer type 'id' to C pointer type 'ABRecordRef' (aka 'const void ') requires a bridged cast [4] CDVContact xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:326:97: note: use __bridge to convert directly (no change in ownership) [4] CDVContact* xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]]; ^ _bridge fix-it:"/Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m":{326:97-326:97}:"_bridge " /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:326:97: note: use __bridge_retained to make an ARC object available as a +1 'ABRecordRef' (aka 'const void ') [4] CDVContact xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]]; ^ __bridge_retained fix-it:"/Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m":{326:97-326:97}:"__bridge_retained " /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:338:92:{338:92-338:135}{338:105-338:135}: error: cast of Objective-C pointer type 'id' to C pointer type 'ABRecordRef' (aka 'const void ') requires a bridged cast [4] CDVContact testContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:j]]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:338:93: note: use __bridge to convert directly (no change in ownership) [4] CDVContact* testContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:j]]; ^ _bridge fix-it:"/Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m":{338:93-338:93}:"_bridge " /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:338:93: note: use __bridge_retained to make an ARC object available as a +1 'ABRecordRef' (aka 'const void ') [4] CDVContact testContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:j]]; ^ __bridge_retained fix-it:"/Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m":{338:93-338:93}:"__bridge_retained " /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:560:21:{560:23-560:67}: warning: incompatible integer to pointer conversion assigning to 'ABAddressBookRef' (aka 'const void *') from 'int' [3] addressBook = ABAddressBookCreateWithOptions(NULL, &error); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:562:9: warning: implicit declaration of function 'ABAddressBookRequestAccessWithCompletion' is invalid in C99 [-Wimplicit-function-declaration,3] ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) { ^ 4 warnings and 3 errors generated.

最佳答案

似乎与使用旧版本 Xcode 在 Snow Leopard 上构建的其他人报告的此问题相关: Running ./cordova/debug / cordova/emulate causes errors"

似乎有计划修复它,但更新到 Mountain Lion 和 Xcode 4.51 将修复它。它对我有用。

关于ios - 无法构建或编译phonegap 2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12912967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com