简体   繁体   English

未捕获的TypeError:无法调用未定义的方法“ openDatabase”-仅从物理设备

[英]Uncaught TypeError: Cannot call method 'openDatabase' of undefined - only from physical device

I am using SQLite plugin for cordova. 我正在为cordova使用SQLite插件。 I'm making a telerik mobile/kendo mobile app. 我正在制作telerik移动/剑道移动应用程序。 I use the telerik appBuilder windows client IDE. 我使用telerik appBuilder Windows客户端IDE。 I clicked plugins and checked the SQLite plugin check box to make sure it is integrated with my app. 我单击了插件,然后选中了SQLite插件复选框,以确保它与我的应用程序集成在一起。

When running the app from the simulator within the telerik appBuilder IDE, the app works fine. 从telerik appBuilder IDE中的模拟器运行该应用程序时,该应用程序运行良好。 But when I remote debug the app from my Android Nexus 5 or just try and use the app at all from the nexus 5, it stalls at the start. 但是,当我从Android Nexus 5远程调试应用程序时,或者只是尝试从nexus 5完全使用该应用程序时,它一开始就停滞了。 I can see in the remote debugger that it says Uncaught TypeError: Cannot call method 'openDatabase' of undefined about the line marked "HERE" in this function: 我可以在远程调试器中看到它说出Uncaught TypeError: Cannot call method 'openDatabase' of undefined在此函数中,关于标记为“ HERE”的行Uncaught TypeError: Cannot call method 'openDatabase' of undefined

app.openDb = function() {
   if (window.navigator.simulator === true) {
        // For debuging in simulator fallback to native SQL Lite
            console.log("Use built in SQLite");
            app.db = window.openDatabase("VCareMobileDB", "1.0", "Shopping List Demo", 200000);
    }
    else {
        console.log("Using SQLite Plugin DB");
            app.db = window.sqlitePlugin.openDatabase("VCareMobileDB"); //HERE
    }
}

Why might this line trigger the error from a physical device and not from the telerik appbuilder simulator? 为什么此行可能触发来自物理设备而不是Telerik Appbuilder模拟器的错误?

Thanks. 谢谢。

You are using two different openDatabase API calls window.openDatabase and window.sqlitePlugin.openDatabase . 您正在使用两个不同的openDatabase API调用window.openDatabasewindow.sqlitePlugin.openDatabase

For window.sqlitePlugin.openDatabase you need to install the plugin. 对于window.sqlitePlugin.openDatabase需要安装插件。

For window.openDatabase you do not need to install any plugin. 对于window.openDatabase不需要安装任何插件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的TypeError无法使用Cordova 3.5调用未定义SQLite插件的方法'opendatabase' - Uncaught TypeError cannot call method 'opendatabase' of undefined-SQLite plugin with cordova 3.5 未捕获的TypeError:无法调用未定义的方法'activityStart' - Uncaught TypeError: Cannot call method 'activityStart' of undefined 未捕获的TypeError:无法调用未定义的方法'getLocalName' - Uncaught TypeError: Cannot call method 'getLocalName' of undefined 未捕获的TypeError:无法调用未定义的方法“列表” - Uncaught TypeError: Cannot call method 'list' of undefined 未捕获的typeError无法调用方法'remove children'未定义且未捕获的typeError无法读取未定义的属性'children' - Uncaught typeError cannot call method 'remove children' of undefined and Uncaught typeError cannot read property 'children' of undefined Uncaught TypeError:无法调用未定义的phonegap android的方法“方法名称” - Uncaught TypeError: Cannot call method 'Method name' of undefined phonegap android Kendo-Cordova-导航-未捕获的TypeError:无法调用未定义的方法'triggerBeforeShow' - Kendo - Cordova - Navigation - Uncaught TypeError: Cannot call method 'triggerBeforeShow' of undefined Titanium错误:未被捕获的TypeError:无法调用未定义的方法“ add” - Titanium error: Uncaught TypeError: Cannot call method 'add' of undefined cordova 1.6.1 android Uncaught TypeError:无法调用undefined的方法'showWebPage' - cordova 1.6.1 android Uncaught TypeError: Cannot call method 'showWebPage' of undefined 尝试使用EmailComposer时出现“ Uncaught TypeError:无法调用未定义的方法'email'” - “Uncaught TypeError: Cannot call method 'email' of undefined” when trying to use EmailComposer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM