Xcode 重复的插件键:FLTGoogleMapsPlugin

Xcode 重复的插件键:FLTGoogleMapsPlugin,xcode,google-maps,dart,flutter,Xcode,Google Maps,Dart,Flutter,我正试图准备一个演示项目使用谷歌地图与颤振,但不知道为什么得到崩溃与这个错误控制台 我跟踪了这个链接 任何帮助都将提前感谢。只是为了澄清评论并提供最终答案-您应该注意,AppDelegate.m文件中不会调用两次[GeneratedPluginRegistrAtRegisterWithRegistry:self] 根据,您的AppDelegate.m应该如下所示: #include "AppDelegate.h" #include "GeneratedPluginRegistrant.h" #

我正试图准备一个演示项目使用谷歌地图与颤振,但不知道为什么得到崩溃与这个错误控制台

我跟踪了这个链接


任何帮助都将提前感谢。

只是为了澄清评论并提供最终答案-您应该注意,AppDelegate.m文件中不会调用两次
[GeneratedPluginRegistrAtRegisterWithRegistry:self]

根据,您的AppDelegate.m应该如下所示:

#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

注:Google Maps for Flatter目前正在开发者预览中。这会增加破坏更改的风险。
重复的插件密钥:
您使用的密钥正确吗?@RubensMelo,我不知道这个插件密钥。你能告诉我,它是什么,我在哪里可以找到它吗?要在你的应用程序中添加一个地图,你必须获得一个谷歌api密钥并用该密钥配置项目:@RubensMelo和TinusJackson好吧,我明白了,写了两行是愚蠢的错误。多谢各位。:)谢谢你的帮助
#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