android - java.net.MalformedURLException : No installed handlers for this URL

标签 android cordova phonegap-plugins

在 PhoneGap V 3.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);}

我在运行 Android 4.4.2 的 nexus 7 上调试应用程序,我收到了这条错误消息

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文件和手动添加plugins js文件,因为它们不是自动添加的。 为什么它们没有自动添加?因为我做错了..

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

关于android - java.net.MalformedURLException : No installed handlers for this URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21850602/

相关文章:

android - 将字符串从 Android Java Activity 传递到广播接收器

Android - 保留 fragment ?

java - 带有 boolean 值的开关/案例请求

ios - 在iOS上使用phonegap

ios - 在 PhoneGap BarcodeScanner 上显示应用程序

android - 如果在 list 文件中定义服务而不在代码中启动服务,android 将如何工作

javascript - 如何使用 Cordova 在同一设备上获取其他已安装应用程序的版本?

ios - 飞溅后 phonegap ios 白屏 - 如何避免

javascript - Phonegap - iOS - 谷歌地图 "Sorry no imagery here"

jquery - 我可以在一个 html 中包含多个 ons-popover 吗?