My application uses Camera plugin to take shots and Transfer plugin to upload photos.
When I build it with ionic build android it works just fine, though starts too slowly, up to 10 seconds.
When it was built with ionic build android --prod it starts much faster, but file uploading doesn’t work.
There is no errors, it looks like call to fileTransfer.upload(...) does nothing.
All other parts including camera still work.
I still have no solution for this problem.
I moved application to 3.1.0 framework version, tried building --release apk, but result is the same.
So any help will be highly appretiated.
Any ideas?
Thanks. You’re right, it was build with the --release key.
Now it available in DevTools, but I can’t see any errors there.
I have some “consolelogs” in code:
console.log('Before image upload');
this.uploadImage(filePath).then( imgResult => {
console.log('After upload');
.....
private uploadImage(imagePath: string):Promise<any> {
console.log('uploadImage start');
let fileOptions: FileUploadOptions = { /* ... options definition here ...*/ };
let serverUrl = /* ... url construction here ... */ ;
console.log(fileOptions);
console.log(serverUrl);
return this.fileTransfer.upload(imagePath,
serverUrl,
fileOptions, true);
}
Though catch isn’t shown in my code snippet it’s definitely there, and it doesn’t catch anything.
So I’ll try to do file upload literally as in your examples.