Android java.net.MalformedURLException:没有为此URL安装处理程序

Android java.net.MalformedURLException:没有为此URL安装处理程序,android,cordova,phonegap-plugins,Android,Cordova,Phonegap Plugins,在PhoneGapV3.3应用程序中,我使用此功能将文件下载到设备 我添加了文件和文件传输插件,并完成了所有配置 downloadAgendaPage = function () { var uri = encodeURI("http://*****/data/***.ics"); window.requestFileSystem( LocalFileSystem.PERSISTENT, 0, function onFileSystemSuccess(fileSystem) {

在PhoneGapV3.3应用程序中,我使用此功能将文件下载到设备 我添加了文件和文件传输插件,并完成了所有配置

downloadAgendaPage = function () {
var uri = encodeURI("http://*****/data/***.ics");
window.requestFileSystem(
    LocalFileSystem.PERSISTENT, 0,
    function onFileSystemSuccess(fileSystem) {
        fileSystem.root.getFile(
            "dummy.pdf", { create: true, exclusive: false },
                function gotFileEntry(fileEntry) {
                    var sPath = fileEntry.fullPath.replace("dummy.pdf", "");
                    var fileTransfer = new FileTransfer();
                    fileEntry.remove();

                    fileTransfer.download(
                            uri,
                            sPath + 'Agenda.ics',
                            function (theFile) {
                                console.log("download complete: " + theFile.toURI());
                                //showLink(theFile.toURI());
                                alertify.alert("Agenda file " + "Agenda.ics" + " downloaded to your root folder");
                            },
                            function (error) {
                                console.log("download error source " + error.source);
                                console.log("download error target " + error.target);
                                console.log("upload error code: " + error.code);
                            }
                    );
                },
            fail);
    },
    fail);}
我正在运行安卓4.4.2的Nexus7上调试应用程序,收到了这个错误消息

02-18 12:04:32.514: W/System.err(21031): java.net.MalformedURLException: No installed handlers for this URL
02-18 12:04:32.514: W/System.err(21031):    at org.apache.cordova.file.FileUtils.getFile(FileUtils.java:684)
02-18 12:04:32.514: W/System.err(21031):    at org.apache.cordova.file.FileUtils.access$5(FileUtils.java:679)
02-18 12:04:32.514: W/System.err(21031):    at org.apache.cordova.file.FileUtils$16.run(FileUtils.java:349)
02-18 12:04:32.514: W/System.err(21031):    at org.apache.cordova.file.FileUtils$24.run(FileUtils.java:473)
02-18 12:04:32.514: W/System.err(21031):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
02-18 12:04:32.514: W/System.err(21031):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
02-18 12:04:32.514: W/System.err(21031):    at java.lang.Thread.run(Thread.java:841)

任何帮助请

这个奇怪错误的原因是我手动更新cordova-plugins.js文件并手动添加插件js文件,因为它们不是自动添加的。 为什么它们不是自动添加的?因为我做错了


答案是,不要先构建,然后添加插件,而是先添加插件,然后构建,然后用您的文件替换www文件。

同样的问题,在我手动更新的cordova-plugins.js文件中发现了问题。更正那个文件解决了这个问题。