Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception: MissingPluginException(No implementation found for method isMapAvailable on channel map_launcher) #59258

Closed
thechawla225 opened this issue Jun 11, 2020 · 7 comments
Labels
c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. package flutter/packages repository. See also p: labels. platform-android Android applications specifically

Comments

@thechawla225
Copy link

I am trying to create a simple button in flutter to open a google maps with a simple location with these coordinates:
31.233568, 121.505504
But evrytime i try to start url_launcher or map_launcher it dosen;t work and gives me this error.
I am getting unhandled exception error for map_launcher and url_launcher both.

In fact another package, google_pay also dosen't work.
I have imported FireBase can that be a reason for my problem?
The error:



[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method isMapAvailable on channel map_launcher)
E/flutter ( 3987): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
E/flutter ( 3987): <asynchronous suspension>
E/flutter ( 3987): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter ( 3987): #2      MapLauncher.isMapAvailable (package:map_launcher/map_launcher.dart:121:21)
E/flutter ( 3987): #3      HomeScreen.build.<anonymous closure> (package:vatsalya2/homescreen.dart:196:39)
E/flutter ( 3987): #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989:19)
E/flutter ( 3987): #5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1095:38)
E/flutter ( 3987): #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter ( 3987): #7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:522:11)
E/flutter ( 3987): #8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter ( 3987): #9      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
E/flutter ( 3987): #10     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
E/flutter ( 3987): #11     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter ( 3987): #12     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9)
E/flutter ( 3987): #13     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter ( 3987): #14     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
E/flutter ( 3987): #15     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
E/flutter ( 3987): #16     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter ( 3987): #17     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter ( 3987): #18     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 3987): #19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 3987): #20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter ( 3987): #21     _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter ( 3987): #22     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter ( 3987): #23     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter ( 3987): #24     _invoke1 (dart:ui/hooks.dart:281:10)
E/flutter ( 3987): #25     _dispatchPointerDataPacket (dart:ui/hooks.dart:190:5)
E/flutter ( 3987): 

I have searched forums which say that my MainActiviy.java file must be edited but i can't find that file anywhere.
I have tried starting a new project and the map opens fine in a new project with just url_launcher and no other plugin installed I have tried flutter clean and flutter upgrade and updated android studio.
I don't know what to do i have read many answers but nothing seems to work.

Flutter doctor - v output:


[√] Flutter (Channel master, 1.19.0-6.0.pre.42, on Microsoft Windows [Version 10.0.18362.900], locale en-IN)
    • Flutter version 1.19.0-6.0.pre.42 at C:\Users\Ankit\Desktop\src\flutter
    • Framework revision d9653445f4 (2 days ago), 2020-06-09 18:43:03 -0400
    • Engine revision e8c13aa012
    • Dart version 2.9.0 (build 2.9.0-14.0.dev 5c1376615e)


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\Ankit\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.45.1)
    • VS Code at C:\Users\Ankit\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.11.0

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!

@VladyslavBondarenko
Copy link

Hi @thechawla225
have you restarted you app after adding these dependencies and executing flutter pub get, right?

in your AndroidManifest.xml do you have io.flutter.embedding.android.FlutterActivity?

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="bug"
        android:usesCleartextTraffic="true">
        <activity
            android:name="io.flutter.embedding.android.FlutterActivity"
...

@VladyslavBondarenko VladyslavBondarenko added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Jun 11, 2020
@thechawla225
Copy link
Author

thechawla225 commented Jun 11, 2020

@VladyslavBondarenko Yes I have restarted the application multiple times after installing these dependencies and have also in fact restarted my PC. I do notice that some lines seem to be different in my AndroidManifest.xml file so here is that part that u mentioned here:

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="vatsalya2"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"

Should I change the following lines in this file or add something new ?
Thanks for replying so quickly.

In addition, there seem to be these red lines in these lines as posted in this screenshot below :
(I noticed them just after reading your post so I apologize for not seeing this earlier.)

Annotation 2020-06-11 225320

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 11, 2020
@VladyslavBondarenko
Copy link

@thechawla225
you say that you can't find MainActiviy.java. Do you have then MainActivity.kt in android/app/src/main/kotlin/<package_name>/?

Is it like this?

package com.example.newapp

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

@VladyslavBondarenko VladyslavBondarenko added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 12, 2020
@thechawla225
Copy link
Author

@VladyslavBondarenko yes that's exactly what the file looks like.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 12, 2020
@VladyslavBondarenko VladyslavBondarenko added framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels Jun 15, 2020
@darshankawar
Copy link
Member

Hi @thechawla225
Are you still experiencing this issue ?
If so, could you please provide a minimal code sample that shows the issue ?
Thanks.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 18, 2020
@thechawla225
Copy link
Author

I have resolved the issue.

Here is how I resolved it:

  1. Flutter clean
  2. Flutter pub get
  3. Flutter run

in my project directory.
this thread can be closed now thanks a lot to everyone.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 28, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. package flutter/packages repository. See also p: labels. platform-android Android applications specifically
Projects
None yet
Development

No branches or pull requests

4 participants