I can’t seem to find any info on the error I’m getting when trying to copy a file taken with the camera to data storage. Here is my function (which is pretty much what everyone seems to do):
copyFileToLocalDir() {
let d = new Date();
let n = d.getTime();
let newFileName = n + ".jpg";
console.log('new name',newFileName);
this.file.copyFile(this.imagePath, this.imageName, cordova.file.dataDirectory, newFileName)
.then(success => {
this.lastImage = newFileName;
}, error => {
console.log('error saving');
});
}
The error I’m getting when running in Android emulator is ERROR Error: Uncaught (in promise): Invalid action
Ionic Info:
cli packages: (/Users/billb/dev/customer-mkt-app/node_modules)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 1.3.7
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.3.0
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.0
ios-sim : 5.0.10
Node : v7.8.0
npm : 4.6.1
OS : macOS Sierra
Xcode : Xcode 9.0 Build version 9A235
Misc:
backend : legacy