eclipse - Could not find class 'android.webkit.WebResourceResponse' when running HelloCordova on Android 2.2 -
i tried follow tutorial: http://docs.phonegap.com/en/2.7.0/guide_getting-started_android_index.md.html#getting%20started%20with%20android
and following error:
05-08 15:35:59.845: e/dalvikvm(307): not find class 'android.webkit.webresourceresponse', referenced method org.apache.cordova.cordovawebviewclient.getwhitelistresponse
here guy explains error: https://issues.apache.org/jira/browse/cb-3041
this known issue. because android 2.3 not have android.webkit.webresourceresponse, code considered dead android 2.3's dalvik. means whitelisting doesn't work on android 4.x, per cb-2099. i'm going keep open, lower priority, since know causes , it's easy "first bug" if want fix this.
he tells fix easy, not explain how fix -.- brilliant!
obviously 1 fix not run android 2.2 emulator because works android 4.2.
but how working in android 2.2?
i want build application compatible api level 8 , up.
this because android 2.2 not have updated webkit webresource response.
try downloading cordova 2.2 jar here , putting in /libs folder @ base of project. if there none, create one. might have add icecreamcordovawebviewclient.java sources (or if choose download source code of cordova , add dependency, can add source)
or can try using regular webviewclient/chromeclient
, doing work yourself, mh outlines in this post, copied below.
if want similar android 2.x, might want try using earlier mentioned
shouldoverrideurlloading(webview view, string url)
avoid loading page, fetch manually, replace reference css file own, , callloaddata(string data, string mimetype, string encoding)
(orloaddatawithbaseurl(string baseurl, string data, string mimetype, string encoding, string historyurl))
on webview, passing in manipulated html content string.
edit:
also, can try adding webresourceresponse , dependencies src folder. try downloading them here
Comments
Post a Comment