本文介绍了PhoneGap的截图插件科尔多瓦2.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了从GitHub上的截图插件,设在这里:

I have set up the screenshot plugin from github, located here:

https://github.com/phonegap/phonegap-plugins/树/主/安卓/截图

我将它作为指导,并与科尔多瓦1.8.1。它的工作,然后将截图保存到手机上。然而,它失败,科尔多瓦2.0.0。

I set it up as instructed and with 1.8.1 of cordova. It worked and the screenshot was saved to the phone. However it fails with cordova 2.0.0.

Screenshot.java code:

Screenshot.java code:

https://github.com/phonegap/phonegap-plugins/blob/master/Android/Screenshot/src/org/apache/cordova/Screenshot.java

Screenshot.js code:

Screenshot.js code:

由于一个非常聪明的人叫西蒙·麦克唐纳的意见,我删除线31和38从上面的JS文件。

Due to the advice of a very clever man called Simon MacDonald, I removed line 31 and 38 from the JS file shown above.

然而,当我尝试使用截图插件与科尔多瓦2.0.0我收到这些错误:

However when I try to use the screenshot plugin with cordova 2.0.0 I receive these errors:

ERROR: org.json.JSONException: Value undefined of type java.lang.String cannot be converted to JSONArray.
Error: Status=8 Message=JSON error
file:///android_asset/www/cordova-2.0.0.js: Line 938 :  Error: Status=8 Message=JSON error
Error: Status=8 Message=JSON error at file:///android_asset_/www/cordova-2.0.0.js:938

在cordova.js的938行是:

line 938 of the cordova.js is:

 // If error, then display error
    else {
        console.log("Error: Status="+v.status+" Message="+v.message);

但即时通讯几乎可以肯定,这是一个兼容性错误。有谁知道这是一个固定的,或者甚至是有原因的。林升技丢失。任何帮助是AP preciated。

but im almost certain this is a compatibility error. Does anyone know a fix for this, or even a reason. Im abit lost. Any help is appreciated.

我所说的screenshot.js与此code:

I call the screenshot.js with this code:

function takeScreenShot() {
cordovaRef.exec("Screenshot.saveScreenshot");

}

任何帮助大量AP preciated。

Any help massively appreciated.

推荐答案

我刚刚升级到支持V2.0.0:

I just upgraded it to support v2.0.0:

这篇关于PhoneGap的截图插件科尔多瓦2.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 07:02