I am trying to prepare a demo project using Google maps with flutter but don't know why getting crash with this error in console
Runner[39966:208120] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: FLTGoogleMapsPlugin'
I have followed this link flutter-io
Any help is appreciated thanks in advance.
Just to clarify the comments and provide a final answer - you should be careful that [GeneratedPluginRegistrant registerWithRegistry:self] is not called twice in your AppDelegate.m file.
As per the Google Maps Flutter plugin readme, your AppDelegate.m should look like this:
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GMSServices provideAPIKey:@"YOUR KEY HERE"];
[GeneratedPluginRegistrant registerWithRegistry:self];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With