Flutter plugin for launching maps

Related tags

Map map_launcher
Overview

Map Launcher

pub package likes popularity pub points GitHub stars GitHub forks

Map Launcher is a flutter plugin to find available maps installed on a device and launch them with a marker or show directions.

Marker Navigation
Marker Navigation

Currently supported maps:
Google Maps
Apple Maps (iOS only)
Google Maps GO (Android only)
Baidu Maps
Amap (Gaode Maps)
Waze
Yandex Maps
Yandex Navigator
Citymapper
Maps.me
OsmAnd
OsmAnd+ (Android only)
2GIS
Tencent (QQ Maps)
HERE WeGo

Breaking Change in v1.1.3

Because of the changes in Android 11 you may need to adjust your gradle version if it's failing to build. You can find solution here

Migrating to v1

Breaking change: map_launcher does not depend on flutter_svg anymore which means you will have to add flutter_svg in your project if you want to use images.

This should allow you to use any version of flutter_svg and it also fixes bunch of issues related to that like #45, #40, etc

The icon property from AvailableMap now returns String instead of ImageProvider so to get it working all you have to do is to go from

Image(
  image: map.icon,
)

to

import 'package:flutter_svg/flutter_svg.dart';

SvgPicture.asset(
  map.icon,
)

Get started

Add dependency

dependencies:
  map_launcher: ^2.1.1
  flutter_svg: # only if you want to use icons as they are svgs

For iOS add url schemes in Info.plist file

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>comgooglemaps</string>
    <string>baidumap</string>
    <string>iosamap</string>
    <string>waze</string>
    <string>yandexmaps</string>
    <string>yandexnavi</string>
    <string>citymapper</string>
    <string>mapswithme</string>
    <string>osmandmaps</string>
    <string>dgis</string>
    <string>qqmap</string>
    <string>here-location</string>
</array>

Usage

Get list of installed maps and launch first

import 'package:map_launcher/map_launcher.dart';

final availableMaps = await MapLauncher.installedMaps;
print(availableMaps); // [AvailableMap { mapName: Google Maps, mapType: google }, ...]

await availableMaps.first.showMarker(
  coords: Coords(37.759392, -122.5107336),
  title: "Ocean Beach",
);

Check if map is installed and launch it

import 'package:map_launcher/map_launcher.dart';

if (await MapLauncher.isMapAvailable(MapType.google)) {
  await MapLauncher.showMarker(
    mapType: MapType.google,
    coords: coords,
    title: title,
    description: description,
  );
}

API

Show Marker

option type required default
mapType MapType yes -
coords Coords(lat, long) yes -
title String no ''
description String no ''
zoom Int no 16
extraParams Map<String, String> no {}
Maps
mapType coords title description zoom extraParams
.google iOS only
see Known Issues section below
.apple
.googleGo
.amap Android only
.baidu
.waze
.yandexMaps
.yandexNavi
.citymapper
does not support marker
shows directions instead
.mapswithme
.osmand iOS only
.osmandplus iOS only
.doubleGis
android does not support marker
shows directions instead
.tencent
.here

Show Directions

option type required default
mapType MapType yes -
destination Coords(lat, long) yes -
destinationTitle String no 'Destination'
origin Coords(lat, long) no Current Location
originTitle String no 'Origin'
directionsMode DirectionsMode no .driving
waypoints List<Coords(lat, long)> no null
extraParams Map<String, String> no {}
Maps
mapType destination destinationTitle origin originTitle directionsMode waypoints extraParams
.google ✓ (up to 8 on iOS and unlimited? on android)
.apple
.googleGo
.amap
.baidu
.waze always uses current location
.yandexMaps
.yandexNavi
.citymapper
.mapswithme only shows marker
.osmand iOS only always uses current location
.osmandplus iOS only always uses current location
.doubleGis
.tencent
.here

Extra Params

It's possible to pass some map specific query params like api keys etc using extraParams option

Here are known params for some maps:

mapType extraParams
.tencent { 'referer': '' }
.yandexNavi { 'client': '', 'signature': '' }

Example

Using with bottom sheet

import 'package:flutter/material.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:flutter_svg/flutter_svg.dart';

void main() => runApp(MapLauncherDemo());

class MapLauncherDemo extends StatelessWidget {
  openMapsSheet(context) async {
    try {
      final coords = Coords(37.759392, -122.5107336);
      final title = "Ocean Beach";
      final availableMaps = await MapLauncher.installedMaps;

      showModalBottomSheet(
        context: context,
        builder: (BuildContext context) {
          return SafeArea(
            child: SingleChildScrollView(
              child: Container(
                child: Wrap(
                  children: <Widget>[
                    for (var map in availableMaps)
                      ListTile(
                        onTap: () => map.showMarker(
                          coords: coords,
                          title: title,
                        ),
                        title: Text(map.mapName),
                        leading: SvgPicture.asset(
                          map.icon,
                          height: 30.0,
                          width: 30.0,
                        ),
                      ),
                  ],
                ),
              ),
            ),
          );
        },
      );
    } catch (e) {
      print(e);
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Map Launcher Demo'),
        ),
        body: Center(child: Builder(
          builder: (context) {
            return MaterialButton(
              onPressed: () => openMapsSheet(context),
              child: Text('Show Maps'),
            );
          },
        )),
      ),
    );
  }
}

Known issues

  • Google Maps for Android have a bug that setting label for a marker doesn't work. See more on Google Issue Tracker

  • On iOS it's possible to "delete" Apple Maps which actually just removes it from homescreen and does not actually delete it. Because of that Apple Maps will always show up as available on iOS. You can read more about it here

Contributing

Pull requests are welcome.

Comments
  • MapLauncher.installedMaps returns empty list

    MapLauncher.installedMaps returns empty list

    MapLauncher.installedMaps returns an empty list. This occurs on my Pixel 2 that has google maps, and several other map_launcher supported maps. I have attempted running flutter clean, but the problem persists.

    Additionally, I can get the desired behavior with the url_launcher launch function and constructing URL requests per here.

    opened by BasPhair 11
  • Unable to start flutter app properly after pub get

    Unable to start flutter app properly after pub get

    I got this error after pub get. Error: "Missing 'package' key attribute on element package at AndroidManifest.xml".

    I have tried flutter clean, restart IDE, etc.. nothing helps..

    [√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19042.746], locale en-MY)
    
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    [!] Android Studio (version 4.1.0)
        X Flutter plugin not installed; this adds Flutter specific functionality.   
        X Dart plugin not installed; this adds Dart specific functionality.
    [√] VS Code (version 1.52.1)
    [√] Connected device (1 available)
    

    Error:

    Launching lib\main.dart on Android SDK built for x86 in debug mode...
    lib\main.dart:1
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:4:9-64 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:4:9-64
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:5:9-68 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:5:9-68
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:6:9-56 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:6:9-56
    
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:7:9-54 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:7:9-54
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:8:9-44 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:8:9-44
    
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:9:9-56 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:9:9-56
    
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:10:9-56 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:10:9-56
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:11:9-62 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:11:9-62
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:12:9-59 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:12:9-59
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:13:9-46 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:13:9-46
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:14:9-57 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:14:9-57
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:15:9-51 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:15:9-51
    C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml Error:
    	Validation failed, exiting
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':map_launcher:processDebugManifest'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
       > Manifest merger failed with multiple errors, see logs
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 10s
    Exception: Gradle task assembleDebug failed with exit code 1
    Exited (sigterm)
    

    AndroidManifest.xml file which related with the error.

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.alexmiller.map_launcher">
    
        <queries>
            <package android:name="com.google.android.apps.maps" />
            <package android:name="com.google.android.apps.mapslite" />
            <package android:name="com.autonavi.minimap" />
            <package android:name="com.baidu.BaiduMap" />
            <package android:name="com.waze" />
            <package android:name="ru.yandex.yandexnavi" />
            <package android:name="ru.yandex.yandexmaps" />
            <package android:name="com.citymapper.app.release" />
            <package android:name="com.mapswithme.maps.pro" />
            <package android:name="net.osmand" />
            <package android:name="ru.dublgis.dgismobile" />
            <package android:name="com.tencent.map" />
        </queries>
    
    </manifest>
    
    opened by kimmanwky 10
  • Replacement of bitmap icons with SVG icons

    Replacement of bitmap icons with SVG icons

    This can help reduce the size of the package after it is compiled. Related to the issue #17.

    @mattermoran TODO: SVG files are temporarily added. Replace them with better SVG files.

    opened by shinsenter 10
  • Version 2.2.1 reports requires IOS 10.0

    Version 2.2.1 reports requires IOS 10.0

    After updating to version 2.2.1, builds ok but get link errors reporting that minimum IOS version must be 10.0. whilst you can change this in Xcode and compile, each time you build, it reverts to IOS 9 and fails.

    opened by 4bSolutionsLLP 9
  • Package key missing

    Package key missing

    Launching lib\main.dart on SM G973F in debug mode... Running Gradle task 'assembleDebug'... C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:5:9-64 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:5:9-64 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:6:9-68 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:6:9-68 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:7:9-56 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:7:9-56 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:8:9-54 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:8:9-54 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:9:9-44 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:9:9-44 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:10:9-56 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:10:9-56 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:11:9-56 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:11:9-56 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:12:9-62 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:12:9-62 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:13:9-59 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:13:9-59 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:14:9-46 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:14:9-46 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:15:9-57 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:15:9-57 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml:16:9-51 Error: Missing 'package' key attribute on element package at AndroidManifest.xml:16:9-51 C:\Users\naazi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\map_launcher-1.1.3+1\android\src\main\AndroidManifest.xml Error: Validation failed, exiting

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':map_launcher:processDebugManifest'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Manifest merger failed with multiple errors, see logs

    opened by muhammednazil 8
  • Unable to determine Swift version

    Unable to determine Swift version

    When attempting to update run pod update, I get the following:

    [!] Unable to determine Swift version for the following pods:
    
    - `map_launcher` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
    

    Can you add SWIFT_VERSION? Thanks!

    opened by SeanOThomas 8
  • map_launcher-0.1.3/ios/Classes/SwiftMapLauncherPlugin.swift:49:22: 'MKCoordinateRegionMake' is unavailable in Swift

    map_launcher-0.1.3/ios/Classes/SwiftMapLauncherPlugin.swift:49:22: 'MKCoordinateRegionMake' is unavailable in Swift

    Hi,

    When trying to build an app using this plugin I'm getting this error in Xcode: /map_launcher-0.1.3/ios/Classes/SwiftMapLauncherPlugin.swift:49:22: 'MKCoordinateRegionMake' is unavailable in Swift

    The same error is there for MKCoordinateSpanMake. The error comes from the launchMap function.

    Flutter doctor:

    [✓] Flutter (Channel master, v1.10.15-pre.330, on Mac OS X 10.15 19A583, locale en-GB)
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 3.3)
    [✓] VS Code (version 1.39.1)
     
    [✓] Connected device (4 available)            
    
    • No issues found!
    
    
    opened by Pebsie 8
  • Dependency issues with gradle plugin version

    Dependency issues with gradle plugin version

    I am wondering what the fix for that was? I tried opening the project on Android Studio, but I cant seem to find the package (build.gradle, settings.gradle), instead I have 'maps_launcher'. I have tried many things like restarting my computer, reopening project, uninstalling android studio, but nothing worked. For some context, I am developing on VSCode with Flutter, testing on Android emulator. Thank you.

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':map_launcher' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    opened by SoftDevCHD 7
  • No Activity found to handle Intent [Google Maps on Android 10 SDK 29)

    No Activity found to handle Intent [Google Maps on Android 10 SDK 29)

    I getting this error when trying to open Google Maps (showMarker()) on an Android 10 compiled with SDK 30. I can assert that Google Maps is installed and that it is present in the list of available maps.

    E/MethodChannel#map_launcher(14912): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=geo:0,0?q=-25.2,-57.5(some_text)&zoom=16 flg=0x10000000 pkg=com.google.android.apps.maps }
    E/MethodChannel#map_launcher(14912): 	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2058)
    E/MethodChannel#map_launcher(14912): 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1716)
    E/MethodChannel#map_launcher(14912): 	at android.app.ContextImpl.startActivity(ContextImpl.java:958)
    E/MethodChannel#map_launcher(14912): 	at android.app.ContextImpl.startActivity(ContextImpl.java:929)
    E/MethodChannel#map_launcher(14912): 	at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
    E/MethodChannel#map_launcher(14912): 	at com.alexmiller.map_launcher.MapLauncherPlugin.launchMap(MapLauncherPlugin.kt:86)
    E/MethodChannel#map_launcher(14912): 	at com.alexmiller.map_launcher.MapLauncherPlugin.onMethodCall(MapLauncherPlugin.kt:109)
    E/MethodChannel#map_launcher(14912): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
    E/MethodChannel#map_launcher(14912): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
    E/MethodChannel#map_launcher(14912): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
    E/MethodChannel#map_launcher(14912): 	at android.os.MessageQueue.nativePollOnce(Native Method)
    E/MethodChannel#map_launcher(14912): 	at android.os.MessageQueue.next(MessageQueue.java:336)
    E/MethodChannel#map_launcher(14912): 	at android.os.Looper.loop(Looper.java:174)
    E/MethodChannel#map_launcher(14912): 	at android.app.ActivityThread.main(ActivityThread.java:7386)
    E/MethodChannel#map_launcher(14912): 	at java.lang.reflect.Method.invoke(Native Method)
    E/MethodChannel#map_launcher(14912): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    E/MethodChannel#map_launcher(14912): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
    
    [✓] Flutter (Channel stable, 2.0.4, on macOS 11.1 20C69 darwin-x64, locale en-CA)
        • Flutter version 2.0.4 at /Users/akc/Applications/flutter
        • Framework revision b1395592de (7 days ago), 2021-04-01 14:25:01 -0700
        • Engine revision 2dce47073a
        • Dart version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/akc/Library/Android/sdk
        • Platform android-30, build-tools 30.0.2
        • ANDROID_HOME = /Users/akc/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.4, Build version 12D4e
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
        • IntelliJ at /Applications/IntelliJ IDEA.app
        • Flutter plugin version 55.0.4
        • Dart plugin version 203.7759
    
    [✓] Connected device (2 available)
        • Nokia 3 1 Plus (mobile) • ROOGAJG930901259 • android-arm64  • Android 10 (API 29)
        • Chrome (web)            • chrome           • web-javascript • Google Chrome 89.0.4389.114
    
    • No issues found!
    
    opened by k-zen 7
  •  android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context

    android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context

    Hello. Thank you for this plugin. Have problem with Android.

    android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? E/MethodChannel#map_launcher( 6917): at android.app.ContextImpl.startActivity(ContextImpl.java:994) E/MethodChannel#map_launcher( 6917): at android.app.ContextImpl.startActivity(ContextImpl.java:970) E/MethodChannel#map_launcher( 6917): at android.content.ContextWrapper.startActivity(ContextWrapper.java:389) E/MethodChannel#map_launcher( 6917): at com.alexmiller.map_launcher.MapLauncherPlugin.launchGoogleMaps(MapLauncherPlugin.kt:73)

    Looks like problem with android side.I will try fix in fork

    opened by LeonidVeremchuk 7
  • Build failed after pub get map_launcher plugin

    Build failed after pub get map_launcher plugin

    I copied map_launcher: ^1.1.3 into my pubsec.yaml, clicked pub get and my application (IOS and Android) throws errors. If I revert changes before I used map_launcher: ^1.1.3 my application works again. Has anyone had this issue before?

    Android error

    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:5:9-64 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:5:9-64
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:6:9-68 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:6:9-68
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:7:9-56 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:7:9-56
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:8:9-54 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:8:9-54
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:9:9-44 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:9:9-44
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:10:9-56 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:10:9-56
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:11:9-56 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:11:9-56
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:12:9-62 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:12:9-62
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:13:9-59 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:13:9-59
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:14:9-46 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:14:9-46
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:15:9-57 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:15:9-57
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:16:9-51 Error:
    	Missing 'package' key attribute on element package at AndroidManifest.xml:16:9-51
    /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml Error:
    	Validation failed, exiting
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':map_launcher:processDebugManifest'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
       > Manifest merger failed with multiple errors, see logs
    

    IOS Error I have attached a file because its a long error but these are the first few lines.

     /Users/edgar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-3.2.1/ios/Classes/LocationPlugin.m:86:43: warning: 'allowsBackgroundLocationUpdates' is only available on iOS 9.0 or newer [-Wunguarded-availability]
                    result(self.clLocationManager.allowsBackgroundLocationUpdates ? @1 : @0);
    

    IOS error.txt

    opened by edgarjc 6
  • showDirections not working on disabled map app

    showDirections not working on disabled map app

    When I try open disabled app in android, I got this error:

    [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.google.com/... flg=0x10000000 pkg=com.google.android.apps.maps }, null, android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.google.com/... flg=0x10000000 pkg=com.google.android.apps.maps } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2051) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1709) at android.app.ContextImpl.startActivity(ContextImpl.java:957) at android.app.ContextImpl.startActivity(ContextImpl.java:928) at android.content.ContextWrapper.startActivity(ContextWrapper.java:383) at com.alexmiller.map_launcher.MapLauncherPlugin.launchMap(MapLauncherPlugin.kt:90) at com.alexmiller.map_launcher.MapLauncherPlugin.onMethodCall(MapLauncherPlugin.kt:113) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319) at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

    try & catch does not work, because the error in the native android code.

    opened by yairsts 1
  • feat: make the destination parameter of showDirections() be nullable.

    feat: make the destination parameter of showDirections() be nullable.

    When it is null, use [destinationTitle] to search destination, currently only some maps support it.

    • [MapType.apple], supported
    • [MapType.google], supported
    • [MapType.googleGo], supported
    • [MapType.amap], supported
    • [MapType.baidu], supported
    • [MapType.tencent], partially supported, you need to manually click the input box to search.
    • others map not tested, fallback to [Coords.zero]
    opened by ipcjs 0
  • Failing to Build Android: Execution failed for task ':map_launcher:parseDebugLocalResources' Change compileSdkVersion to 31

    Failing to Build Android: Execution failed for task ':map_launcher:parseDebugLocalResources' Change compileSdkVersion to 31

    I'm having trouble while building for android. Below the output for 'flutter run': `FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':map_launcher:parseDebugLocalResources'.

    There was a failure while populating the build operation queue: Failed to create MD5 hash for file content.

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. `

    I already executed flutter clean and flutter pub get

    The flutter doctor output: `Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel unknown, 2.10.5, on Microsoft Windows [Version 10.0.22621.819], locale pt-BR) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.3.5) [√] Android Studio (version 2021.2) [√] VS Code (version 1.73.1) [√] Connected device (4 available) [√] HTTP Host Availability

    • No issues found! `

    I've solved changing compileSdkVersion from 28 to 31 on plugin build.gradle file.

    opened by vgobbi8 0
Owner
Alex Miller
Alex Miller
A migration of Google Maps Application with Flutter & Google Maps APIs including: Maps SDK for Android & IOS, Places API & polylines

google_maps A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

TAD 1 Mar 4, 2022
Flutter Maps A Flutter app using Google Maps SDK & Directions API

Flutter Maps A Flutter app using Google Maps SDK & Directions API Plugins The plugins used in this project are: google_maps_flutter geolocator flutter

Salsabil Mohamed Hemada 1 Jul 15, 2022
A flutter plugin for Google Maps

IMPORTANT: This plugin is no longer under development Why? We initially built this plugin to fill an early gap in flutter. Since then, Google has made

AppTree Software, Inc 415 Dec 29, 2022
Apple Maps Plugin for Flutter

apple_maps_flutter A Flutter plugin that provides an Apple Maps widget. The plugin relies on Flutter's mechanism for embedding Android and iOS views.

Luis Thein 50 Dec 31, 2022
A Flutter plugin for integrating Google Maps in iOS, Android and Web applications

flutter_google_maps A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobi

MarchDev Toolkit 86 Sep 26, 2022
A flutter plugin that's decodes encoded google poly line string into list of geo-coordinates suitable for showing route/polyline on maps

flutter_polyline_points A flutter plugin that decodes encoded google polyline string into list of geo-coordinates suitable for showing route/polyline

Adeyemo Adedamola 75 Oct 25, 2022
A Flutter plugin which provides 'Picking Place' using Google Maps widget

Google Maps Places Picker Refractored This is a forked version of google_maps_place_picker package, with added custom styling and features.

Varun 5 Nov 13, 2022
Mapbox-flutter - A repository to demonstrate the use of Mapbox - it's Maps and Navigation SDKs in a Flutter application

MapBox Flutter This repository contains code corresponding to the Youtube video

AB Satyaprakash 39 Dec 30, 2022
Flutter Google Maps Tutorial

Flutter Google Maps Tutorial YouTube Video Setup Get an API Key at https://cloud.google.com/maps-platform/ Enable Maps SDK for Android, Maps SDK for i

Marcus Ng 85 Nov 30, 2022
A Flutter app using Google Maps SDK & Directions API

Flutter Maps A Flutter app using Google Maps SDK & Directions API Plugins The plugins used in this project are: google_maps_flutter geolocator flutter

Youhaan bootwala 1 Mar 18, 2022
A Flutter app using Google Maps SDK & Directions API

Flutter Maps A Flutter app using Google Maps SDK & Directions API Plugins The plugins used in this project are: google_maps_flutter geolocator flutter

Varun CN 2 Apr 19, 2022
This is a Flutter package that uses the Google Maps API to make a TextField that tries to autocomplete places as the user types, with simple smooth animations, making a nice UI and UX.

search_map_place This is a Flutter package that uses the Google Maps API to make a TextField that tries to autocomplete places as the user types, with

Lucas Bernardi 127 Oct 22, 2022
A Flutter package to provide the native maps to Android/iOS

platform_maps_flutter A Flutter package that provides a native map to both Android and iOS devices. The plugin relies on Flutter's mechanism for embed

Luis Thein 70 Aug 13, 2022
Here Maps Package for Flutter

here_maps_webservice About here_maps_webservice provides Here Maps Web Services API wrapper that serve different purposes from search, to geocoding. U

Ayush Bherwani 11 Dec 15, 2022
Easy Google Maps for Flutter

easy_google_maps Easy Google Maps for Flutter on Web and Mobile Getting Started Mobile Follow setup for Mobile Here Web Good to go! EasyGoogleMaps(

Rody Davis 69 Jul 19, 2022
A Mapbox GL flutter package for creating custom maps

Flutter Mapbox GL Please note that this project is community driven and is not an official Mapbox product. We welcome feedback and contributions. This

flutter-mapbox-gl 917 Dec 31, 2022
Place picker on Google Maps for Flutter

Google Maps Place Picker A Flutter plugin which provides 'Picking Place' using Google Maps widget. The project relies on below packages. Map using Flu

Terry Kwon 178 Dec 16, 2022
A car rental flutter application using firebase and google maps API

A car sharing & rental app using Flutter, Firebase & Google Maps APIs ?? About the App ?? hopOn is flutter based application for car sharing and renta

Shivani Singh 97 Dec 30, 2022
Simple flutter app demonstrating usage of Google Maps

flutter_maps_example Get an API key at GoogleCloud. Enable Google Map SDK for ea

Tornike Gogberashvili 0 Nov 23, 2022