|
想做一个预存号码,点击即可自动拨号的工具,
在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
-------------------------
请问,问题出在什么地方?怎么才能解决这个问题呢? |
|