Cordova条码插件扫描未返回Android应用程序页面

Cordova条码插件扫描未返回Android应用程序页面,android,cordova,cordova-plugins,qr-code,Android,Cordova,Cordova Plugins,Qr Code,当我在Android Cordova项目中扫描条形码时,我使用以下代码: cordova.plugins.barcodeScanner.scan( function (result) { myXMLString = result.text; if (result != null){ document.location.href = "MyPage.html"; } }, functio

当我在Android Cordova项目中扫描条形码时,我使用以下代码:

cordova.plugins.barcodeScanner.scan(
     function (result) {

         myXMLString = result.text;

         if (result != null){

         document.location.href = "MyPage.html";

         }

     },
     function (error) {
         alert("Scanning failed: " + error);
     }
  );
但是,当我在设备上运行应用程序时,扫描完成,我收到消息

Application Error

net::ERR_FILE_NOT_FOUND (file:///android_asset/www/MyPage.html
控制台日志显示: E/AndroidProtocolHandler:无法打开资产URL:file:///android_asset/www/MyPage.html


我该如何解决这个问题?我在Android Studio项目的assets/www文件夹中有这个文件。它可以在Windows和iOS平台上工作。

您的项目根目录(www)文件夹中是否有MyPage.html?我在这里有:MyProject/Platforms/android/assets/wwwI我在平台文件夹外询问您的项目结构是的,它也在那里,当我从androidstudio构建时,我通常在assets/www中编辑文件,然后将它们复制到platforms文件夹外的主项目结构中。我应该使用cordova build android重建吗?该错误是否表明它正在android_asset/www中查找文件?