Android crash when google maps is draged

Hi.

I have an error with my app when i try to drag and move google-maps, the app crash and it’s show me the classical error from android “Unfortunately the application is stopped”. This issue happened with android and only with some devices , for example with a device Nexus 6 and 6.0.1(android version) or with Samsung s4 and 5.0.1(android version).

The issue didn’t happen with others devices or other different versions of android.

I tested with angular-google-maps, ngMap and directly with javascript api v3 from google, but the issue always exists.

I tested with the template ionic-starter-maps and the issue exists too. In this case the logcat show me:

01-13 11:30:23.230 11212 11267 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
01-13 11:30:23.231 11212 11267 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x338 in tid 11267 (Chrome_InProcGp)
01-13 11:30:23.282 9227 9227 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-13 11:30:23.282 9227 9227 F DEBUG : Build fingerprint: ‘google/shamu/shamu:6.0.1/MMB29S/2489379:user/release-keys’
01-13 11:30:23.282 9227 9227 F DEBUG : Revision: ‘0’
01-13 11:30:23.282 9227 9227 F DEBUG : ABI: ‘arm’
01-13 11:30:23.282 9227 9227 F DEBUG : pid: 11212, tid: 11267, name: Chrome_InProcGp >>> com.ionicframework.maps627861 <<<
01-13 11:30:23.282 9227 9227 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x338
01-13 11:30:23.298 9227 9227 F DEBUG : r0 00000010 r1 00000000 r2 00000000 r3 00000001
01-13 11:30:23.298 9227 9227 F DEBUG : r4 80000000 r5 40000000 r6 20000000 r7 000006f0
01-13 11:30:23.298 9227 9227 F DEBUG : r8 00000000 r9 00000000 sl 00000001 fp 00000004
01-13 11:30:23.298 9227 9227 F DEBUG : ip 00000001 sp 98e7f1b4 lr a932a1ad pc a93b9f9e cpsr 80070030
01-13 11:30:23.301 9227 9227 F DEBUG :
01-13 11:30:23.301 9227 9227 F DEBUG : backtrace:
01-13 11:30:23.301 9227 9227 F DEBUG : #00 pc 001bef9e /system/vendor/lib/egl/libGLESv2_adreno.so (EsxGfxMem::UpdateTimestampBucketId(EsxContext const*, unsigned int, EsxAccessType)+65)
01-13 11:30:23.301 9227 9227 F DEBUG : #01 pc 0012f1a9 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::BucketRenderingCmds()+588)
01-13 11:30:23.302 9227 9227 F DEBUG : #02 pc 001b0d0d /system/vendor/lib/egl/libGLESv2_adreno.so (EsxCmdMgr::Flush(EsxFlushReason)+76)
01-13 11:30:23.302 9227 9227 F DEBUG : #03 pc 0031dcb7 /data/app/com.google.android.webview-2/lib/arm/libwebviewchromium.so
01-13 11:30:23.988 9227 9227 F DEBUG :
01-13 11:30:23.988 9227 9227 F DEBUG : Tombstone written to: /data/tombstones/tombstone_06
01-13 11:30:23.988 9227 9227 E DEBUG : AM write failed: Broken pipe
01-13 11:30:23.989 859 875 I BootReceiver: Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
01-13 11:30:23.991 859 11356 W ActivityManager: Force finishing activity com.ionicframework.maps627861/.MainActivity
01-13 11:30:24.071 859 5833 I OpenGLRenderer: Initialized EGL, version 1.4

What do you think about this issue??? Somebody can help me??

Thanks and i’m sorry for my english.

2 Likes

Same problem here on a nexus 5x, android 6.01, webview 47.0.2526.100 . sometimes even without any dragging. Without markers it seems to work fine.

Hi, i put an issue in the chromium project, seems like an issue with the webview in some devices, especially almost all Nexus.

This is the issue: https://code.google.com/p/chromium/issues/detail?id=577218

Having this issue as well on a Nexus 6P fully updated. The map loads and then crashes on any movement to the map.

I have the same issue with a fully updated N6P. The app loads and when map is opened it crashes. The same app works when map is not there. However, the N5 with latest updates work fine.

I created this ionic project and built it with phonegap build. See https://dl.dropboxusercontent.com/u/1275078/HelloCordova-debug.apk try nexus 6p / nexus 5x and move the map around after it gets you position. The app crashes every single time.

Source code is here https://dl.dropboxusercontent.com/u/1275078/HelloCordova-Location.zip

Looks like a google maps bug when using it with cordova. Any ideas? No useful error in logcat. iOS works fine and this is just on Android.

Hi, this problem is an issue with the webview in some devices, especially the Nexus… I resolved this issue using leafletjs for the map (http://leafletjs.com/). If you want, you can use the google maps layers.

Thanks, did you mean that you used leaflet.js and still map tiles from Google? Or did you say you are using maps from leafletjs also?

I’m using leaflet.js and map tiles from google, this plugin https://github.com/shramov/leaflet-plugins allow this.

Cheers.

add whitelist plugin in your app

cordova-plugin-whitelist is already added. Check out my comment above with the sample app.

I figured it out! :smiley:
I literally spent hours till I got it. All you have to do is set draggable to true on the markers like this:

var marker = new google.maps.Marker({
position: markerLatLng,
map: map,
title: tempItems[i].name,
draggable: true
});

The problem was only happening on my Nexus 5x, but it worked on an iPhone6, iPhone5c, and the Asus Zendphone2. If this doesn’t work, comment out your markers and see if the maps come up at all. For me, it was ONLY the markers that where causing troubles.

1 Like

Awesome, just tried it with draggable: true and maps work fine. Great job. Worked on nexus 6p and nexus 5x that crashed with the sample apk above.

Now the crash is avoided which is a great thing. Now I have to look at how to avoid certain pins from being dragged at all.

Yeah, it’s not perfect, but at least it doesn’t crash. I’m trying to figure out a work around atm. Let me know if you figure anything out

Stupid work around:

          userMarker.addListener('drag', function() {
            console.log("hi");
            userMarker.setPosition(myLatlng);
          });

This way it’s selectable, so it doesn’t crash, but they can’t move the marker. Far from perfect, but it works. :sunny:

2 Likes

Aside from the temporary workaround, is the origin of the problem known?
I’m guessing it has to do with the device/android version.

For the record: I’m using a Nexus 6P with Android 6.0.1 and I’m experiencing the crash

This is a known bug in webview latest live android webview. This is fixed in https://plus.google.com/communities/105434725573080290360

Join beta and update your https://play.google.com/store/apps/details?id=com.google.android.webview and things work fine.

See bug report here https://code.google.com/p/chromium/issues/detail?id=541145 and fixed in beta above.

Great
I just got and update of the Android System Webview but it was only the M48 release.
Just knowing that a fix has been found and is on the way is more than enough for me, thanks!

This is also an issue when using polyline and drawing on the map. Only affects Nexus 5x.
Anyone else encountered this issue?

This worked for me

android:hardwareAccelerated="false"

on androidmanifest.xml