0

最近我的笔记本电脑崩溃了,在我修复它之后,我决定切换到 Ubuntu 而不是 Windows。设置完所有相关内容后,我可以继续使用cordova开发我的android应用程序,但我无法运行在旧设置中使用windows等运行良好的代码。

(注意:不管我是在虚拟机还是在真实设备上运行代码)

问题出在 javascript 文件中的代码片段中。

console.log("empty directory");
console.log(window.location);
console.log("location");

window.resolveLocalFileSystemURI(dirPath, function(fileEntry) 
{
    console.log("after resolveLocalFileSystem");

这是错误消息。

   01-03 16:03:46.805: I/Web Console(18647): empty directory at file:///android_asset /www/update/update.js:145
   01-03 16:03:46.805: I/Web Console(18647): file:///android_asset/www/index.html at file:///android_asset/www/update/update.js:146
   01-03 16:03:46.805: I/Web Console(18647): location at file:///android_asset/www/update/update.js:147
   01-03 16:03:46.825: E/Web Console(18647): Uncaught TypeError: Object [object Object] has no method 'exec' at file:///android_asset/www/cordova-2.2.0.js:983

如您所见,window.resolve... 之前的每个 console.log 都可以正常工作,但没有“resolveLocalFileSystem 之后”日志。只是未捕获的 TypeError。

在第 983 行我发现了这个

   var messages = nativeApiProvider.get().exec(service, action, callbackId, argsJson);

但是 nativeApiProvider.get() 是空的,所以真的没有方法 exec。

我现在真的不知道该怎么办,因为我在互联网上几乎没有发现任何关于这个问题的信息,而且我不知道是什么原因造成的。

谢谢您的帮助!

4

0 回答 0