简体   繁体   中英

Cordova on Android 4.4 CSS and Javascript compatibility

I'm developing a cordova app, testing on Android 7 and 6 everything works. When I try to install the app on an Android 4.4 device it starts, but the CSS is rendered very bad (missing borders and other ugly stuff) and some Javascript functions are not supported (eg Array.forEach).
I think because the webview on Android 4.4 is old but I don't know how to solve this.
I tried to install Crosswalk but it does nothing, it doesn't appear in navigator.userAgent so I think it doesn't work. I have this in my plugin list:

cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine"

And this in my navigator.userAgent

"Mozilla/5.0 (Linux; Android 4.4.2; Android SDK built for x86 Build/KK) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36"

I solved the problem myself. Crosswalk was the solution but I failed at installing it because you need to build from cordova and not from Android Studio. I was building from android studio because cordova gave me an error with gradle version. I fixed the build from cordova, reinstalled crosswalk and now I can use it without problems and it supports all the new functionalities.

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