2012-10-16 65 views
0

系統信息。 Xcode:4.3.3 OSX:10.7.4無法建立或編譯phonegap 2.1

我已經下載phonegap 2.1(孵化器 - 科爾多瓦 - IOS)。我已經使用文檔中提到的命令行代碼成功創建了該項目。

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

我用下面的代碼來構建我的項目。 $ /路徑/到/ my_new_cordova_project /科爾多瓦/調試

當我嘗試調試,我得到錯誤以下錯誤

/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.

回答