question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setMyLocationEnabled crash map

See original GitHub issue

I’m submitting a … (check one with “x”) [ ] question [X] any problem or bug report [ ] feature request

The plugin version: (check one with “x”) [ ] 2.0-beta3 (github) [X] 2.0 (npm)

If you choose ‘problem or bug report’, please select OS: (check one with “x”) [X] Android [ ] iOS

cordova information: (run $> cordova plugin list)

cordova-plugin-console 1.0.7 "Console"
cordova-plugin-googlemaps 2.0.11 "cordova-plugin-googlemaps"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.3 "Cordova WKWebView Engine"

Current behavior: After opening the map sometimes, setMyLocationEnabled blocks all subsequent operations

Expected behavior: Maps should continue to run

Steps to reproduce: git clone https://github.com/sirhaplo/v2.0-demo.git cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID=“” cordova platform add android cordova run

In the demo select Map -> getMap().

Kepp doing back and forward between this pages. At certain point the first map will not have the location button and the map below is not loaded

Related code, data or error log (please format your code or data): I added this line to the demo : map.setMyLocationEnabled(true);

var div = document.getElementById("map_canvas1");
var map = plugin.google.maps.Map.getMap(div);
map.one(plugin.google.maps.event.MAP_READY, function() {
    map.setMyLocationEnabled(true);
  console.log("--> map_canvas1 : ready.");
});

If setted in controls in getMap the current position did not create problems. Also if setted after a long processing after the map_ready did not create problems. Only sometimes in map_ready

I solved using controls in getMap, but this could be useful to others.

Thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sirhaplocommented, Oct 31, 2017

There it is : https://youtu.be/CoBoXjZL4wY

The problem is at 14s

0reactions
sirhaplocommented, Nov 2, 2017

I tested the new version and the bug it’s vanished.

Good job !

Read more comments on GitHub >

github_iconTop Results From Across the Web

android crashes after using setMyLocationEnabled on ...
i'm trying to use google map v2 on my android application. ... if i use setMyLocationEnabled(true) on my map it will crash on...
Read more >
Set current location enabled crashing for Android version 6
For devices having Android version 6 the following line causes the application to crash this.tomtomMap.setMyLocationEnabled(true);
Read more >
Bug: Issue with Android 6.0 Runtime Permissions and ...
When using Google Play Services 8.3 i have a problem with the setMyLocationEnabled() method in the GoogleMap class and Android 6.0 devices.
Read more >
How to fix Maps when it crashes - Android - Google Maps Help
If the Google Maps app on your phone or tablet crashes or has other issues that affect your experience on Maps, try the...
Read more >
Android Question GoogleMaps App Crash Mystery - B4X
However, I am getting crash reports in Crashlytics which say the following: ... com.google.maps.api.android.lib6.impl.bf.c :) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found