android - Android上的Camera Cordova插件问题
问题描述
我的应用程序使用 ionic 1 和cordova-camera-plugin。它在 ios 上运行良好。但是在 android 上它第一次要求相机权限然后应用程序崩溃,然后当我再次尝试时,我收到以下错误: file:///storage/emulated/0/Android/data/com.company.test/cache/ .Pic.jpg 通过 ClipData.Item.getUri() 暴露在应用程序之外
我有任何帮助..请在下面找到我的代码:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
var cameraOptions = {
quality: 100,
targetWidth: 400,
targetHeight: 400,
destinationType: Camera.DestinationType.DATA_URL,
correctOrientation: true
};
navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
}
function cameraSuccess(imageURI){
$scope.$apply(function () {
//some code
});
}
//here is where i am getting the error
function cameraError(message)
{
console.log(message);
//alert('Failed because: ' + message);
}
解决方案
推荐阅读
- spring - 具有默认值的 Thymeleaf 表单数组
- graphql - GraphQL 如何包装查询
- laravel - SQLSTATE[HY000] [2002]php_network_getaddresses:getaddrinfo 失败:不知道这样的主机
- ajax - 使用 ajax 添加到购物车时如何添加 Woocommerce 通知(无需重新加载)?
- excel - 如何在 VBA 编程中获取错误详细信息?
- java - 如何用java创建一个hastebin
- firebase - Flutter Firebase,注销我以外的其他用户
- python - Django 查询集。用一个查询注释不同的字段
- html - 响应式 flexbox 页脚不会填满屏幕
- ios - 分支 io:为通用链接设置自定义域