起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1623|回复: 1

[结贴] 求助,使用拨号cordova插件,生成APP出错

[复制链接]

2

主题

3

帖子

17

积分

新手上路

Rank: 1

积分
17
QQ
发表于 2018-8-11 22:53:02 | 显示全部楼层 |阅读模式
想做一个预存号码,点击即可自动拨号的工具,
在github上下载了这个插件https://github.com/rohfosho/CordovaCallNumberPlugin

做了一个按钮简单的点击拨号来测试
js源码

define(function(require){
        var $ = require("jquery");
        var justep = require("$UI/system/lib/justep");
        require("cordova!call-number")
       
        var Model = function(){
                this.callParent();
        };

        Model.prototype.callClick = function(event){
                window.plugins.CallNumber.callNumber(       
                                function onSuccess(result){
                                             console.log("Success:call number"+result);
                                           },
                                function onError(result) {
                                              console.log("Error:call number"+result);
                                           },
                                "12345678901",true)

        };

        return Model;
});
----------------
生成app最后一步出错,主要的错误提示如下
--------------
.........
   注: 某些输入文件使用或覆盖了已过时的 API。
   注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
....... .
D:\WeX5\model\Native\call\build\src\platforms\android\src\com\rohithvaranasi\callnumber\CFCallNumber.java:27: 错误: 找不到符号
       cordova.requestPermission(this, requestCode, CALL_PHONE);
              ^
     符号:   方法 requestPermission(CFCallNumber,int,String)
     位置: 类型为CordovaInterface的变量 cordova
   D:\WeX5\model\Native\call\build\src\platforms\android\src\com\rohithvaranasi\callnumber\CFCallNumber.java:36: 错误: 找不到符号
         if (cordova.hasPermission(CALL_PHONE)) {
                    ^
     符号:   方法 hasPermission(String)
     位置: 类型为CordovaInterface的变量 cordova
   :compileDebugJavaWithJavac FAILED
   
   BUILD FAILED
   
   Total time: 1 mins 18.561 secs
   注: 某些输入文件使用或覆盖了已过时的 API。
   注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
   注: 某些输入文件使用了未经检查或不安全的操作。
   注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
   2 个错误
   
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':compileDebugJavaWithJavac'.
   > Compilation failed; see the compiler error output for details.
   
   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
   
   D:\WeX5\model\Native\call\build\src\platforms\android\cordova\node_modules\q\q.js:126
                       throw e;
                       ^
   Error code 1 for command: cmd with args: /s /c "D:\WeX5\model\Native\call\build\src\platforms\android\gradlew cdvBuildDebug -b D:\WeX5\model\Native\call\build\src\platforms\android\build.gradle -Dorg.gradle.daemon=true --offline"
   ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
   You may not have the required environment or OS to build this project
   Error: cmd: Command failed with exit code 1
****ERROR****: 子任务 "exec" 执行失败。
****ERROR****: 任务 "buildAndroid" 执行失败。
****ERROR****: 执行出错:
****ERROR****: 错误信息: exec returned: 1
****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
-------------------------
请问,问题出在什么地方?怎么才能解决这个问题呢?

2

主题

3

帖子

17

积分

新手上路

Rank: 1

积分
17
QQ
 楼主| 发表于 2018-8-12 14:00:25 | 显示全部楼层
解决了,版本问题,我用的还是3.5的老版本,换成新的3.8就没问题了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-9-24 19:19 , Processed in 0.106855 second(s), 28 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表