2013-09-23 115 views
0

「類聯繫人無法找到」我的應用程序調用,當我得到這個錯誤:的PhoneGap:錯誤在黑莓10

navigator.contacts.find(fields, onSuccess, onError, options); 

使用onerror回調--->類聯繫人無法找到。

我認爲這可能是一個與插件配置有關的問題。在我plugins.xml我有這樣一行:

<plugin name="Contacts"  value="org.apache.cordova.pim.Contact"/> 

和config.xml文件:

<feature id="blackberry.identity" required="true" version="1.0.0.0" /> 
<feature id="blackberry.pim.Address" required="true" version="1.0.0.0" /> 
<feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" /> 

我與PhoneGap的2.7.0建築,我也跟着api guide。 並部署到BB10模擬器。

我不知道'聯繫人'有什麼配置問題,有什麼想法嗎?

編輯:這是我的BB10

<?xml version="1.0" encoding="UTF-8"?> 

<!-- 
    Widget Configuration Reference: 
    http://docs.blackberry.com/en/developers/deliverables/15274/ 
--> 

<widget xmlns="http://www.w3.org/ns/widgets" 
     xmlns:rim="http://www.blackberry.com/ns/widgets" 
     version="1.0.0.0" 
     id="com.xxxxx.xxxx"> 

    <name>xxxx</name> 

    <author href="http://www.xxxxx.es" email="[email protected]"> 
     xxxxx 
    </author> 

    <description> 
     xxxxx description. 
    </description> 

    <license href="http://opensource.org/licenses/alphabetical"> 
    </license> 

    <!-- Cordova API --> 
    <feature id="blackberry.system" required="true" version="1.0.0.0" /> 
    <feature id="org.apache.cordova" required="true" version="1.0.0" /> 
    <feature id="blackberry.find" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.identity" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.identity.phone" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.io.file" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.utils" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.io.dir" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.app" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.app.event" required="true" version="1.0.0.0" /> 
    <feature id="blackberry.system.event" required="true" version="1.0.0.0"/> 
    <feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/> 
    <feature id="blackberry.media.camera" /> 
    <feature id="blackberry.ui.dialog" /> 
    <feature id="blackberry.connection" /> 
    <feature id="blackberry.bbm.platform" /> 
    <feature id="blackberry.invoke.card" /> 
    <feature id="blackberry.pim.contacts" /> 
    <feature id="blackberry.ui.contextmenu" /> 
    <feature id="blackberry.io.filetransfer" /> 
    <feature id="blackberry.io" /> 
    <feature id="blackberry.invoke" /> 
    <feature id="blackberry.invoked" /> 
    <feature id="blackberry.push" /> 
    <feature id="blackberry.media.microphone" required="true" version="1.0.0.0"/> 

    <!-- Cordova API --> 
    <access subdomains="true" uri="file:///store/home" /> 
    <access subdomains="true" uri="file:///SDCard" /> 

    <!-- Expose access to all URIs, including the file and http protocols --> 

    <access uri="*" subdomains="true" /> 
    <access uri="http://phonegap.com" subdomains="true"/> 
    <access uri="http://debug.build.phonegap.com" subdomains="true"/> 
    <access uri="http://xxxxx.com" subdomains="true"/> 

    <!-- 
    <icon rim:hover="false" src="res/icon/blackberry/icon-80.png" /> 
    <icon rim:hover="true" src="res/icon/blackberry/icon-80.png" /> 
    --> 
    <icon rim:hover="false" src="res/icon/blackberry/windows_phone_62x62.png" /> 
    <icon rim:hover="true" src="res/icon/blackberry/windows_phone_62x62.png" /> 

    <rim:loadingScreen backgroundColor="#CFCFCF" 
        foregroundImage="res/screen/blackberry/screen-225.png" 
      onFirstLaunch="true"> 
    <rim:transitionEffect type="fadeOut" /> 
    </rim:loadingScreen> 

    <content src="index.html" /> 

    <rim:permissions> 
    <rim:permit>use_camera</rim:permit> 
    <rim:permit>read_device_identifying_information</rim:permit> 
    <rim:permit>access_shared</rim:permit> 
    <rim:permit>read_geolocation</rim:permit> 
    <rim:permit>record_audio</rim:permit> 
    <rim:permit>access_pimdomain_contacts</rim:permit> 
    </rim:permissions> 


</widget> 
+0

你可以發佈你的完整config.xml嗎? – jeffheifetz

+0

我剛添加到我的帖子。謝謝:) – wendigo

+0

嗨,找到了解決方案。我也有同樣的困境。當我在出現異常的源代碼中設置斷點時,我發現cordova只加載了以下插件**(NetworkStatus,Accelerometer,Device,Battery,Compass,Camera,Capture,Logger,Notification,Media,File,InAppBrowser,FileTransfer )** –

回答

0

config.xml中你正在使用的功能ID是舊版本的黑莓OS的。請使用<feature id="blackberry.pim.contacts" />

+0

感謝您的答案,但我的config.xml中已包含該條目。我也嘗試過評論「聯繫人」條目。 – wendigo