系统信息 Xcode:4.3.3 OSX: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:错误:使用未声明的标识符' ABAddressBookCreateWithOptions' [3] if(& ABAddressBookCreateWithOptions!= NULL){ ^ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:253:24:警告:隐含的函数声明' ABAddressBookCreateWithOptions'在C99中无效[-Wimplicit-function-declaration,3] addrBook = ABAddressBookCreateWithOptions(NULL,NULL); ^ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:253:22:{253:24-253:66}:警告:不兼容的整数到指针转换分配给' ABAddressBookRef' (又名' const void *')来自' int' [3] addrBook = ABAddressBookCreateWithOptions(NULL,NULL); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:326:96:{326:96-326:139}{326:109-326:139}:错误:施放Objective-C指针类型& #39; ID'到C指针类型' ABRecordRef' (又名' const void ')需要桥接演员[4] CDVContact xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:326:97:注意:使用__bridge直接转换(所有权没有变化)[4] CDVContact * xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]]; ^ _ 桥 fix-it:" /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m" ;: {326:97-326:97}:" _bridge&#34 ; /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:326:97:注意:使用__bridge_retained使ARC对象可用作+1' ABRecordRef' (又名' 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}:错误:施放Objective-C指针类型& #39; ID'到C指针类型' ABRecordRef' (又名' const void ')需要桥接演员[4] CDVContact testContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:j]]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:338:93:注意:使用__bridge直接转换(所有权没有变化)[4] CDVContact * testContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:j]]; ^ _ 桥 fix-it:" /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m" ;: {338:93-338:93}:" _bridge&#34 ; /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:338:93:注意:使用__bridge_retained使ARC对象可用作+1' ABRecordRef' (又名' 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}:警告:不兼容的整数到指针转换分配给' ABAddressBookRef' (又名' const void *')来自' int' [3] addressBook = ABAddressBookCreateWithOptions(NULL,& error); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/virtusa3/pgt/myproject1/CordovaLib/Classes/CDVContacts.m:562:9:警告:隐含的函数声明' ABAddressBookRequestAccessWithCompletion'在C99中无效[-Wimplicit-function-declaration,3] ABAddressBookRequestAccessWithCompletion(addressBook,^(bool grant,CFErrorRef error){ ^ 产生了4个警告和3个错误。
答案 0 :(得分:1)
似乎与使用旧版Xcode构建在Snow Leopard上的其他人报告的此问题有关: Running ./cordova/debug / cordova/emulate causes errors"
似乎有计划修复它,但更新到Mountain Lion和Xcode 4.51将修复它。它确实适合我。