I'm trying to unzip a .zip file in my application made in cordova for android but I get the following error:
cordova.callbackFromNative('Zip1655561780',false,9,["An error occurred while unzipping."], false);
My code is:
function onDeviceReady(){
// When the user clicks some button to select the file
$$('#btn-actualizar').on('click',function(){
processZip('file:///storage/emulated/0/Download/emoji.zip', "/storage/emulated/0");
});
}
function processZip(zipSource, destination){
// Handle the progress event
var progressHandler = function(progressEvent){
var percent = Math.round((progressEvent.loaded / progressEvent.total) * 100);
// Display progress in the console : 8% ...
console.log(percent + "%");
};
// Proceed to unzip the file
window.zip.unzip(zipSource, destination, (status) => {
if(status == 0){
console.log("Archivo Extraido Satisfactoriamente...");
}
if(status == -1){
console.error("Error, No es Posible Extraer El Archivo...");
}
}, progressHandler);
}
In console sends the following:
Error, No es Posible Extraer El Archivo...
window.zip.unzip @ actualizarApp.js:31
fail @ zip.js:24
callbackFromNative @ cordova.js:293
(anonymous) @ VM88:1 //de aquí sale el error antes mencionado