mapsplugin/cordova-plugin-googlemaps

Android: plugin causes stop updating the dom until touch

n00dl3 opened this issue · 8 comments

OK, so this is a weird bug, on Android (tested on HTC One m9 and Samsung galaxy S5).

I'm using angular js and Cordova: 5.2.0 to build my app, when I install this plugin, the webview isn't rendered anymore until I touch.

If I use the inspector, the DOM has changed, but it is not rendered on the webView. If and only if I touch the screen, then everythng is updated, animations are played, etc...

It happens since the last Webview Components update from the playstore, everything was working fine until then...

I'll try to find the problem, but It's been a while I've not developped any native Android App, so any help would be appreciated 😄 .

Thanks

Ok, for the moment, I see the problem comes from these lines (195 to 197 in /src/android/plugin/google/maps/GoogleMaps.java):

if (Build.VERSION.SDK_INT >= 11){
          view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

If I change view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); to view.setLayerType(View.LAYER_TYPE_HARDWARE, null); everything is drawn normally on the webview. I didn't test much for the moment, but it seems to work...

I'm on Crosswalk, I don't see any issues. I don't know why Masashi implemented this, but I will change this to hardware by default, as I'm going to stop support for old android versions.

Still, I do recommend that you should integrate crosswalk as well.. It has huge performance improvements..

Can anybody else confirm this issue? I think changing this globally will cause errors on many devices (some devices can't render transparent when webview is hardware accelerated). It will not effect Crosswalk, but maybe other Android-Versions. I need to know if anybody else has this problem. Will postpone this to version 1.3.4 or 1.3.5 until I got some more feedback.

Maybe it's time to make a breaking change and force hardware acceleration.. and for those folks stucking on black screen, they should switch to using a modern webengine like crosswalk

I also had the same issue with Sencha Touch. However it was observed only with the latest beta WebView (46.0.2490.52) version on Lollipop devices.

After changing to hardware rendering for SDK_INT >= 11 my app broke for pre-Lollipop devices. So I have enabled hardware accelleration only for SDK_INT >= 21 (Lollipop and up) and it seems to work both on older devices and new ones. But this may not be the case for other javascript frameworks and apps.

Guys,
it seems that it is a bug in the WebView and recommendation is to use hardware accelleration for >=L devices until it is fixed. You can see it here: https://plus.google.com/+JasonOgasian/posts/QTodsDrkGxj

Related bug can be followed up at http://crbug.com/520152

That's what I thought first, but couldn't find any report/ticket about that... thank you @roberthovhannisyan ...

Incorporated L check. Let's hope it does not cause other problems.
I'll recommend everybody to include Crosswalk!