【问题标题】:Every native call will get uncaught:Exception caught:(TypeError):Cannot call method 'xxx' of undefined每个本机调用都不会被捕获:异常被捕获:(TypeError):无法调用未定义的方法'xxx'
【发布时间】:2016-01-17 14:36:31
【问题描述】:

我的配置是:

Ubuntu server 14.04 64 bit
GWT 2.7
Cordova 5.4.1
Andorid SDK Manage 24.04.1
Andorid SDK Tools 24.04.1
Andorid SDK Platform-Tools 23.1
Andorid SDK Build-Tools 23.0.2
Andorid 5.1.1(API 22) SDK Platform

我从这里下载了 gwtphoneget 展示

https://github.com/vipulz/gwt-phonegap.showcase

并让它在浏览器中运行(通过超级开发模型),然后编译它,然后按照这个:

https://ccoenraets.github.io/cordova-tutorial

创建一个标准的cordova项目,添加andorid平台,将showcase文件夹,showcase.html和一些资源文件复制到cordova项目的www文件夹,将showcase.html重命名为index.html,并添加

<script type="text/javascript" src="cordova.js"></script>

之前

<script type="text/javascript" src="showcase/showcase.nocache.js"></script>

然后 cd 到平台/andorid,运行

cordova run android

然后我的手机上安装了一个应用程序(运行 android 4.4.2

似乎所有gwt / js的东西都可以,我可以点击菜单到对应的视图,但是所有的原生调用都不起作用,例如,点击ACCELEROMETER,跳转到对应的视图然后点击[开始]按钮,它会给出警报:

uncaught:Exception caught:(TypeError):Cannot call method 'watchAcceleration' of undefined

实际上每个本地调用都会给出类似的错误,我做错了什么?

【问题讨论】:

    标签: cordova mgwt


    【解决方案1】:

    最后,我发现插件安装后(如下所示),对应的功能起作用了


    cordova插件添加cordova-plugin-camera

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-23
      • 1970-01-01
      • 2021-09-21
      • 1970-01-01
      • 2012-08-27
      • 1970-01-01
      • 1970-01-01
      • 2013-01-27
      相关资源
      最近更新 更多