2014-03-13 146 views
0

你好傢伙我在我以前的應用程序中的導航器中遇到問題,它正在工作,但現在它不工作,我嘗試了很多方式,但無法找出問題。導航器不工作inphonegap

phonegap -v is 3.3.0-0.19.6 
cordova -v is 3.3.1-0.4.2 

安裝插件我嘗試以下類型

cordova plugin add org.apache.cordova.camera 
cordova plugin add org.apache.cordova.dialogs 

下面是我的config.xml文件

<?xml version='1.0' encoding='utf-8'?> 
<widget id="com.company.multipleScreen" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
<name>Hello Cordova</name> 
<preference name="AllowInlineMediaPlayback" value="false" /> 
<preference name="BackupWebStorage" value="cloud" /> 
<preference name="DisallowOverscroll" value="false" /> 
<preference name="EnableViewportScale" value="false" /> 
<preference name="KeyboardDisplayRequiresUserAction" value="true" /> 
<preference name="MediaPlaybackRequiresUserAction" value="false" /> 
<preference name="SuppressesIncrementalRendering" value="false" /> 
<preference name="TopActivityIndicator" value="gray" /> 
<preference name="GapBetweenPages" value="0" /> 
<preference name="PageLength" value="0" /> 
<preference name="PaginationBreakingMode" value="page" /> 
<preference name="PaginationMode" value="unpaginated" /> 
<feature name="LocalStorage"> 
    <param name="ios-package" value="CDVLocalStorage" /> 
</feature> 
<name>testing</name> 
<description> 
    A sample Apache Cordova application that responds to the deviceready event. 
</description> 
<author email="[email protected]" href="http://cordova.io"> 
    Apache Cordova Team 
</author> 
<content src="index.html" /> 
<access origin="*" /> 
<feature name="Camera"> 
    <param name="ios-package" value="CDVCamera" /> 
</feature> 
<feature name="Media"> 
    <param name="ios-package" value="CDVSound" /> 
</feature> 
<feature name="File"> 
    <param name="ios-package" value="CDVFile" /> 
    <param name="onload" value="true" /> 
</feature> 
<feature name="Capture"> 
    <param name="ios-package" value="CDVCapture" /> 
</feature> 
<feature name="Globalization"> 
    <param name="ios-package" value="CDVGlobalization" /> 
</feature> 
<feature name="Notification"> 
    <param name="ios-package" value="CDVNotification" /> 
</feature> 

我試圖實現對顯示警告的代碼是

navigator.notification.alert("Unable to connect to server !"); 

和我的其他要求是相機它也沒有工作

navigator.camera.getPicture(onSuccess, onFail, { quality: 50, 
destinationType: Camera.DestinationType.FILE_URI }); 

function onSuccess(imageURI) { 
var image = document.getElementById('myImage'); 
image.src = imageURI; 
} 

function onFail(message) { 
alert('Failed because: ' + message); 
} 

回答

0

問題是由添加

cordova plugin add org.apache.cordova.device 
cordova plugin add org.apache.cordova.console