phonegap / phonegap-plugin-contentsync

Download and cache remotely hosted content
Apache License 2.0
206 stars 98 forks source link

net::ERR_FILE_NOT_FOUND on android #180

Closed Frankobingen closed 6 years ago

Frankobingen commented 7 years ago

Synchronization seems to work quite well, however after the sync i do the following as shown in the example.

sync.on('complete', function(data) {
        if(data.localPath) {
          var url = "file://"+data.localPath + "/www/index.html";
          alert('Sync complete ' + data + ' changing document.location ' + url );
          ContentSync.loadUrl(url);
          // document.location = url;
        }
 });

I've tried both - ContentSync.loadUrl and document.location. the loadUrl method doesn't seem to do anything. Document.location leads to

net::ERR_FILE_NOT_FOUND(file:///data/user/0/com.phonegap-helloworld/files/myapp/www/index.html)

macdonst commented 7 years ago

@Frankobingen did you try:

var url = "file://"+data.localPath + "/index.html";
macdonst commented 6 years ago

Closing, inactivity. Please comment/re-open if you have more details.