java.net.MalformedURLException: ไม่มีการติดตั้งตัวจัดการสำหรับ URL นี้

ในแอปพลิเคชัน PhoneGap V 3.3 ฉันใช้ฟังก์ชันนี้เพื่อดาวน์โหลดไฟล์ไปยังอุปกรณ์ ฉันเพิ่มปลั๊กอิน File และ File-transfer และทำการกำหนดค่าทั้งหมด

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);}

ฉันกำลังแก้ไขข้อบกพร่องแอปพลิเคชันบน Nexus 7 ที่ใช้ Android 4.4.2 และฉันได้รับข้อความแสดงข้อผิดพลาดนี้

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)

โปรดช่วยด้วย


person Abou-Emish    schedule 18.02.2014    source แหล่งที่มา


คำตอบ (1)


สาเหตุของข้อผิดพลาดประหลาดนี้คือ ฉันได้อัปเดตไฟล์ Cordova-plugins.js ด้วยตนเองและเพิ่มไฟล์ปลั๊กอิน js ด้วยตนเอง เนื่องจากไฟล์เหล่านั้นไม่ได้ถูกเพิ่มโดยอัตโนมัติ เหตุใดจึงไม่เพิ่มโดยอัตโนมัติ เพราะว่าฉันทำผิด..

คำตอบคืออย่าสร้างแล้วเพิ่มปลั๊กอิน แต่ให้เพิ่มปลั๊กอินแทนแล้วสร้างแล้วแทนที่ไฟล์ www ด้วยของคุณ

person Abou-Emish    schedule 25.02.2014
comment
ปัญหาเดียวกันที่นี่ พบปัญหาในไฟล์ Cordova-plugins.js ที่อัปเดตด้วยตนเองของฉัน การแก้ไขไฟล์นั้นช่วยแก้ปัญหาได้ - person Uilleann; 10.08.2014