简体   繁体   中英

Worklight application does not run on device when cordova is updated to 2.9

I was receiving this error

"Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse"

when running a simple android application on an android device. I updated the cordova.jar file within the "libs" folder within the android project folder by downloading the new cordova-2.9.jar file, renaming it to "cordova.jar" and replacing it with the original jar file. Now when I run the app logcat shows no error or warnings but the screen is black and the last seven logcat messages are

07-15 15:07:14.226: D/CordovaWebView(24584): >>> loadUrlNow()

07-15 15:07:14.326: D/CordovaActivity(24584): onMessage(onPageStarted,file:///data/data/com.PrototypeApp/files/www/skinLoader.html)

07-15 15:07:14.366: D/webkit-timers(24584): [JWebCoreJavaBridge::resume] >> do resume

07-15 15:07:14.486: D/dalvikvm(24584): GC_CONCURRENT freed 344K, 44% free 3415K/6023K, external 0K/0K, paused 2ms+3ms

07-15 15:07:15.167: D/Cordova(24584): onPageFinished(file:///data/data/com.PrototypeApp/files/www/skinLoader.html)

07-15 15:07:15.177: D/CordovaActivity(24584): onMessage(onPageFinished,file:///data/data/com.PrototypeApp/files/www/skinLoader.html)

07-15 15:07:17.189: D/CordovaActivity(24584): onMessage(spinner,stop)

No initialization happens of the js and html files within my common and android folder. I am using android api 10 and my phone is android 2.3.4. Does anyone know why there is no initialization or how to fix my problem? Thank you

Some background:
The error you see is in fact an Apache Cordova defect , fixed in Cordova 2.7. Worklight uses Cordova 2.6.

The defect affects a subset of devices that also happen to use Android OS v2.x; some devices will only show an error in LogCat, others may crash.

This issue will be addressed in a near-future release of Worklight 6.0.0.x.

That said,
Worklight does not support the "upgrade" method (or any method) for Cordova that you've tried to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM