1

I am trying to use Extractzipfile plugin for ios at "https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ExtractZipFile".

But when i use this plugin in ios it's show error:

2013-04-05 11:20:17.968 fileandzip[751:c07] ERROR: Plugin 'ExtractZipFilePlugin' not found, or is not a      CDVPlugin. Check your plugin mapping in config.xml.
  2013-04-05 11:20:17.969 fileandzip[751:c07] -[CDVCommandQueue executePending] [Line 103] FAILED   pluginJSON = [
    "ExtractZipFilePlugin733749280",
    "ExtractZipFilePlugin",
    "extract",
    [
      "test.zip",
      "\/Users\/alienware\/Library\/Application Support\/iPhone Simulator\/6.1\/Applications\/4BCA6B22-C582-  4529-92FF-4C7E54E82C18\/Documents\/ex"
    ]
  ]

I do everything in guild file. anyone help me fix it! Thanks a lot...

Edit:

this is my code:

    <!DOCTYPE HTML>
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <meta name="description" content="">
                <meta name="author" content="">
                    <link rel="stylesheet" href="css/jquery.mobile-1.1.1.min.css" />

                    <script src="cordova-2.5.0.js"></script>
                    <script src="js/jquery-1.7.2.min.js"></script>
                    <script src="js/jquery.mobile-1.1.1.min.js"></script>
                    <script src="js/jquery.xdomainajax.js"></script>
                    <script src="js/xml2json.js"></script>
                    <script src="js/ZipPlugin.js"></script>
                    <script src="js/jquery-ui.min.js"></script>
                    <script src="js/jquery.ui.touch-punch.min.js"></script>

                    <script type="text/javascript" charset="utf-8">

                        function onGetDirectorySuccess(dir) {
                            console.log("Created dir "+dir.name);
                        }

                        function onGetDirectoryFail(error) {
                            console.log("Error creating directory "+error.code);
                        }

                        var sa;
                        document.addEventListener("deviceready", onDeviceReady, true);

                        function onDeviceReady() {
                            console.log("device is ready");
                            window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
                            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
                            $('#import').click(function(){
                                               var ft = new FileTransfer();
                                               ft.download(
                                                           "http://smartphone.thnt.vn/VietGames/GhepTranhTu/test.zip",
                                                           window.rootFS.fullPath + "/ex/test.zip",
                                                           function(entry) {
                                                           window.alert("download complete: " + entry.fullPath);

                                                           },
                                                           function(error) {
                                                           console.log("download error" + error.code);
                                                           }
                                                           );
                            });
                            $('#unzip').click(function(){
                                               window.plugins.extractZipFile.extractFile('test.zip',window.rootFS.fullPath + '/ex',win,fail);
                                              function win(status)
                                              {
                                              window.alert('Success'+status);
                                              }

                                              function fail(error)
                                              {
                                              alert("error:" + error);
                                              }

                                              });

                        }

                        function fail() {
                            console.log("failed to get filesystem");
                        }

                        function gotFS(fileSystem) {
                            console.log("got filesystem");

                            // save the file system for later access
                            console.log(fileSystem.root.fullPath);
                            window.rootFS = fileSystem.root;
                            window.rootFS.getDirectory("ex", {create: true, exclusive: false}, onGetDirectorySuccess, onGetDirectoryFail);
                        }

                        </script> 
                    <style>
                        img {
                            max-width: 200px;
                        }
                        </style>
    </head>
    <body onload="init();" >
        <h2>Image Download Demo</h2>

        <div id="status"></div>

        <div id="photos">
            <canvas id="canvas" style="width:200;height:400;border: 1px solid #cc0000;"></canvas>
            <input id="unzip" type="button" value="unzip"/>
            <input id="import" type="button" value="import"/>
        </div>

    </body>
</html>
Lê Huy
  • 195
  • 1
  • 4
  • 13

1 Answers1

0

I think this is missing from your settings

In the Cordova.plist (Search for this plist) section, you need to add the plugin with the key/pair value of:

ExtractZipFilePlugin(Key) ExtractZipFilePlugin(Value)

iphonic
  • 12,615
  • 7
  • 60
  • 107
  • You may find your answer here http://stackoverflow.com/questions/13629796/phonegap-ios-plugin-notificationex-cdvplugin-h-file-not-found – iphonic Apr 08 '13 at 08:37