И вы можете изменить функцию, чтобы удалить ненужные console.log, я только что тестировал.
ользую Ionic 3 Android сборки APK и пытаюсь загрузить изображение изФайл: ///storage/emulated/0/data/io.ionic.vdeovalet/cache/image.jpeg
takePicture(sourceType) { try { // Create options for the Camera Dialog var options = { quality: 100, destinationType: this.camera.DestinationType.FILE_URI, encodingType: this.camera.EncodingType.JPEG, sourceType: sourceType, }; this.camera.getPicture(options).then((imagePath) => { // Special handling for Android library if (this.platform.is('android') && sourceType === this.camera.PictureSourceType.PHOTOLIBRARY) { this.filePath.resolveNativePath(imagePath) .then(filePath => { let correctPath = filePath.substr(0, filePath.lastIndexOf('/') + 1); let currentName = imagePath.substring(imagePath.lastIndexOf('/') + 1, imagePath.lastIndexOf('?')); this.copyFileToLocalDir(correctPath, currentName, this.createFileName()); this.lastImage = filePath; }); } else { var currentName = imagePath.substr(imagePath.lastIndexOf('/') + 1); var correctPath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1); this.copyFileToLocalDir(correctPath, currentName, this.createFileName()); } }, (err) => { this.presentToast('Error while selecting image.'); }); } catch (e) { console.error(e); } }
Ошибка: не разрешено загружать локальный ресурс
Android 6.0.1