在Android 2.2上运行HelloCordova时,无法找到类“android.webkit.WebResourceResponse”

在Android 2.2上运行HelloCordova时,无法找到类“android.webkit.WebResourceResponse”,第1张

概述我试图遵循这个教程: http://docs.phonegap.com/en/2.7.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android 并得到以下错误: 05-08 15:35:59.845: E/dalvikvm(307): Could not find class 'android. 我试图遵循这个教程:
http://docs.phonegap.com/en/2.7.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

并得到以下错误:

05-08 15:35:59.845: E/dalvikvm(307): Could not find class 'androID.webkit.WebResourceResponse',referenced from method org.apache.cordova.CordovaWebVIEwClIEnt.getWhiteListResponse

这里一个人解释错误:https://issues.apache.org/jira/browse/CB-3041

This is a kNown issue. Because AndroID 2.3 does not have androID.webkit.WebResourceResponse,this code is consIDered dead by AndroID 2.3's Dalvik. This means your whiteListing doesn't work properly like it does on AndroID 4.x,as per CB-2099. I'm going to keep this open,but lower the priority,since we kNow what causes it and it's an easy "First BUG" for someone if they really want to fix this.

他告诉修复很容易,但不解释如何解决它 –
辉煌!

显然,一个修复是不能运行它与AndroID 2.2模拟器,因为它适用于AndroID 4.2.

但是如何让它在AndroID 2.2中工作?

我想要构建一个与API 8级以上兼容的应用程序.

解决方法 这是因为AndroID 2.2没有WebResource响应的更新的Webkit.

尝试从here下载cordova 2.2 jar并将其放在您/项目底部的/ libs文件夹中.如果没有,创建一个.您可能还需要向您的来源添加IceCreamCordovaWebViewClient.java(或者如果您选择下载cordova的源代码并将其添加为依赖关系,则可以将其添加到该源)

或者您可以尝试使用常规的WebVIEwClIEnt / ChromeClIEnt并自己进行工作,如this post中的MH概述,复制如下.

If you want to do something similar for AndroID 2.x,you might want to
try using the earlIEr mentioned shouldOverrIDeUrlLoading(WebVIEw
vIEw,String url)
to avoID loading the page,fetch it manually,
replace the reference to the CSS file with your own,and finally call
loadData(String data,String mimeType,String enCoding) (or
loadDataWithBaseURL(String baseUrl,String data,
String enCoding,String historyUrl))
on the WebVIEw,passing in the
manipulated HTML content as a string.

编辑:

此外,您还可以尝试将WebResourceResponse和依赖项添加到src文件夹.尝试从here下载

总结

以上是内存溢出为你收集整理的在Android 2.2上运行HelloCordova时,无法找到类“android.webkit.WebResourceResponse”全部内容,希望文章能够帮你解决在Android 2.2上运行HelloCordova时,无法找到类“android.webkit.WebResourceResponse”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1133989.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存