這裏是我的問題與PhoneGap的3.3.0-0.17.1:的PhoneGap 3.3 - 不能識別插件
my-computer-3411:www giampaolo$ phonegap local plugin list
[phonegap] nl.x-services.plugins.socialsharing
[phonegap] org.apache.cordova.camera
[phonegap] org.apache.cordova.core.camera
[phonegap] org.apache.cordova.core.file
[phonegap] org.apache.cordova.core.file-transfer
[phonegap] org.apache.cordova.core.geolocation
[phonegap] org.apache.cordova.device
[phonegap] org.apache.cordova.file
[phonegap] org.apache.cordova.file-transfer
[phonegap] org.apache.cordova.media
[phonegap] org.apache.cordova.media-capture
的PhoneGap版本
my-computer-3411:www giampaolo$ phonegap -v
3.3.0-0.17.1
當我嘗試使用此代碼訪問攝像機:
navigator.camera.getPicture(
function (imageURI) {
//Remove old data
localStorage.removeItem('currentPhoto');
localStorage.removeItem('currentTag');
localStorage.setItem('currentPhoto', imageURI);
Backbone.history.navigate('/shot/preview/', {trigger: true});
},
function (m) {
console.log(m);
alert('some problem');
},
{
quality: 50,
targetWidth: 600,
targetHeight: 600,
destinationType: navigator.camera.DestinationType.FILE_URI,
correctOrientation: true
}
);
我得到這個錯誤(第14行是執行console.log):
I/Web Console(1530): Class not found at file:///android_asset/www/controllers/Camera.js:14
任何提示/想法?
用手機3.3改變了一些東西?隨着phonegap 3.0它運作良好。 謝謝。
在Cordova/Phonegap 3.3中,相機代碼對我來說工作正常。我認爲你的項目結構設置不正確或什麼 - 在vanilla Cordova/Phonegap項目中沒有'/ www/controllers /'文件夾......這是一個主幹。嘗試從您的代碼中刪除Backbone,看它是否有效。甚至只是將'Backbone.history.navigate()'行註釋掉。 – MBillau