map_launcher icon indicating copy to clipboard operation
map_launcher copied to clipboard

Maps.me Android issue

Open rtfmko opened this issue 2 years ago • 6 comments

Problem with open Maps.me on Android. With showDirections and showMarker. Version: map_launcher: ^2.2.3

Stack Trace:

E/MethodChannel#map_launcher(29650): Failed to handle method call
E/MethodChannel#map_launcher(29650): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=mapsme://map?v=1&ll=50.4115,30.6497 flg=0x10000000 pkg=com.mapswithme.maps.pro }
E/MethodChannel#map_launcher(29650): 	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2100)
E/MethodChannel#map_launcher(29650): 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1747)
E/MethodChannel#map_launcher(29650): 	at android.app.ContextImpl.startActivity(ContextImpl.java:1135)
E/MethodChannel#map_launcher(29650): 	at android.app.ContextImpl.startActivity(ContextImpl.java:1106)
E/MethodChannel#map_launcher(29650): 	at android.content.ContextWrapper.startActivity(ContextWrapper.java:420)
E/MethodChannel#map_launcher(29650): 	at com.alexmiller.map_launcher.MapLauncherPlugin.launchMap(MapLauncherPlugin.kt:89)
E/MethodChannel#map_launcher(29650): 	at com.alexmiller.map_launcher.MapLauncherPlugin.onMethodCall(MapLauncherPlugin.kt:112)
E/MethodChannel#map_launcher(29650): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#map_launcher(29650): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#map_launcher(29650): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#map_launcher(29650): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#map_launcher(29650): 	at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#map_launcher(29650): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#map_launcher(29650): 	at android.os.Looper.loopOnce(Looper.java:226)
E/MethodChannel#map_launcher(29650): 	at android.os.Looper.loop(Looper.java:313)
E/MethodChannel#map_launcher(29650): 	at android.app.ActivityThread.main(ActivityThread.java:8669)
E/MethodChannel#map_launcher(29650): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#map_launcher(29650): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/MethodChannel#map_launcher(29650): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Code sample:

try {
    bool? result = await MapLauncher.isMapAvailable(availableMap!.mapType);
    if (result ?? false) {
       await MapLauncher.showDirections(
          mapType: availableMap.mapType,
          destination: Coords(lat, lon),
        );
    } else {
      throw LaunchException("isMapAvailable result $result", LocaleKeys.errors_open_map.tr());
    }
  } catch (error, stackTrace) {
    throw LaunchException(error.toString(), LocaleKeys.errors_open_map.tr(), stackTrace: stackTrace);
  }

Flutter Doctor:

[√] Flutter (Channel stable, 3.0.3, on Microsoft Windows [Version 10.0.19044.1806], locale en-US) • Flutter version 3.0.3 at C:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 676cefaaff (9 days ago), 2022-06-22 11:34:49 -0700 • Engine revision ffe7b86a1e • Dart version 2.17.5 • DevTools version 2.12.2

Tested on three Android devices:

Realme 6, Android sdk: 29 version: 10 (RMX2001) Samsung Galaxy S22 Ultra, Android sdk: 31 version: 12 (S908B) Realme GT Neo2, Android sdk: 31 version 12 (RMX3370)

rtfmko avatar Jul 01 '22 17:07 rtfmko

I can confirm that i got the exact same problem. Maps.me not working anymore...

sgenou avatar Jul 06 '22 19:07 sgenou

I guess in the new version of maps.me they changed the url scheme. Will try to find the new one when got time

mattermoran avatar Jul 08 '22 08:07 mattermoran

It seems that Waze has the problem too... Google Maps works well...

sgenou avatar Jul 09 '22 13:07 sgenou

We ran into the same issue as well with Maps.me. We currently disabled Maps.me support for android devices and will add it again later.

@sgenou Waze did not seem to cause any problems on my test setup: Android 12, map_launcher 2.4.0

RANSoftRA avatar Dec 20 '22 07:12 RANSoftRA

I just tested on installed version of maps.me on my device (v12) and it worked fine, after updating to v14 it stopped working indeed. They definitely did remove support for mapsme:// url scheme I guess it's time to move to universal links

mattermoran avatar Dec 20 '22 10:12 mattermoran

Same problem here. Thanks to mapType, the workaround is easy.

gmarizy avatar Sep 15 '23 10:09 gmarizy