map_launcher icon indicating copy to clipboard operation
map_launcher copied to clipboard

MissingPluginException(No implementation found for method getInstalledMaps on channel map_launcher)

Open keithyeohh opened this issue 1 year ago • 13 comments

I am getting the error as per title in

  • iOS 18.0 (actual device),
  • iOS 17.0 (simulator)

Working fine in

  • Android simulator (Pixel_8_Pro_API_VanillaIceCream)

Added the following to Info.plist image

And this is my source code image image

It basically failed to read the function .installedMaps

keithyeohh avatar Aug 01 '24 01:08 keithyeohh

That seems like something that would happen if you installed the plugin into already running app because it has the dart part but not native one. Could you try restarting the app and also try flutter clean to be sure. Let me know if you still have that issue after that

mattermoran avatar Aug 01 '24 07:08 mattermoran

Hey @mattermoran , yup that is what I google-ed and found too. Unfortunately, the issue persists still.

I tried to re-build the app from following methods, none works.

  1. flutter run --flavor {app-scheme}
  2. build it directly from Xcode

I even tried to uninstall the app, and reinstall, no joy too :(

Also, tried to run in verbose mode, same output image

image

keithyeohh avatar Aug 01 '24 15:08 keithyeohh

Could you try to clone the repo and run the included example app to see it works?

mattermoran avatar Aug 01 '24 15:08 mattermoran

@mattermoran yup, I've tested the example app and it is working correctly on my simulator. Hence I wonder which part of my project not installing the package correctly.

keithyeohh avatar Aug 01 '24 15:08 keithyeohh

It's very strange because there should be nothing special. One thing I'd recommend to try is to create a brand new flutter app and install the plugin same way you done and see if there's any difference

mattermoran avatar Aug 01 '24 15:08 mattermoran

I'll be closing this issue as I don't think it's an issue with this plugin.

mattermoran avatar Sep 29 '24 19:09 mattermoran

I am facing this issue right now, and it's blocking a release.

Many things have happened lately with platform updates mostly from Android side, with the advent of new permissions and foldable devices. I also had to upgrade many other libs and I'm even considering reassembling the entire app on top of a new Flutter (blank) application — which would take the team several days, but it's been weeks of fixing stuff so far already.

Forgive me the rant. Let me know if I can help debugging this, as it may affect applications transitioning between platform versions. I suspect of something at the Gradle layer, but I'm no expert.

emyller avatar Dec 15 '24 20:12 emyller

I suspect of something at the Gradle layer, but I'm no expert.

I say that because map_launcher works as expected when in debug mode. 3.5.0, just reinstalled and ran fresh tests.

emyller avatar Dec 15 '24 20:12 emyller

@emyller does it work on a freshly created flutter project? I would be happy to help out but without being able to reproduce I have no way of understanding what's going on.

mattermoran avatar Dec 15 '24 22:12 mattermoran

@mattermoran It took us a few days — as mentioned above — to reassemble the entire app on top of a new flutter create project. The plugin works now.

I don't know what could have changed yet, but it's certainly not our own code. I will soon check out the delta for anything relevant. For now we really need to unblock releasing. Thank you for being around, hopefully I'll be able to provide helpful intel soon.

emyller avatar Dec 29 '24 20:12 emyller

The issue happens as soon as one enables shrinking when in release mode. This explains why the plugin only works in debug mode.

@mattermoran I believe there must be some rule to add to android/app/proguard-rules.pro, but I lack understanding of how this works. For now I will disable shrinking which I suppose is acceptable by Google for production.

emyller avatar Dec 29 '24 23:12 emyller

I read and experimented a bit further. In order to fix this issue right now, the developer must add the following to their android/app/proguard-rules.pro (or whatever is specified in proguardFiles) file:

-keep class com.alexmiller.map_launcher.** { *; }  # https://pub.dev/packages/map_launcher

Now I am not sure if the library is able to include its own ProGuard-rules file, or if this just has to be added to the documentation. I am sorry I can't find time right now to learn more and send a patch — though I might sometime soon.

Happy New Year!

emyller avatar Dec 29 '24 23:12 emyller

Thanks for the investigation. It explains why the plugin was being stripped out. I'll check what needs to be added on the plugin side for it to be kept around or update readme.

mattermoran avatar Dec 30 '24 06:12 mattermoran

so I did the research and it doesn't look like a standard to include the rules in the plugin directly. I went through all flutter official plugins as well as plus ones and neither have them. I will close this issue let me know if I should reopen if you think otherwise

mattermoran avatar Aug 21 '25 19:08 mattermoran

Thanks for the update. I think it's worth at least mentioning in the plugin documentation, as figuring this out requires some amount of debugging abilities. I'd love to submit a PR myself though I'm AFK for a while... though I'm happy to keep the issue closed and hope search engines will lead people here.

emyller avatar Aug 21 '25 21:08 emyller

I'm happy to add it in the docs I'm just trying to figure out if the issue somewhere else? It's strange that it happens only in this plugin I'm sure you have more plugins do all of them include it?

mattermoran avatar Aug 21 '25 21:08 mattermoran

I'm happy to add it in the docs I'm just trying to figure out if the issue somewhere else? It's strange that it happens only in this plugin I'm sure you have more plugins do all of them include it?

Very good point. Yes we had a list of maybe a dozen rules we were able to track but ultimately decided to disable shrinking and accept a bigger app size for the sake of our small team's sanity. The documentation around this is so poor, or maybe we were all just doing something wrong. 🤷

emyller avatar Aug 21 '25 21:08 emyller

seems like flutter has an open issue about documenting this exact behavior https://github.com/flutter/flutter/issues/136909 I'll subscribe to that issue and once they provide some guidance on best practice for plugin authors I'll make sure to implement.

mattermoran avatar Aug 21 '25 21:08 mattermoran