我正在尝试在flutter项目中实现GoogleMaps,它在android版本上工作正常,但是在iOS版本上,我遇到了一些问题。
错误标题显示:
Runner.xcworkspace不存在
这是我要遵循的指南:https://codelabs.developers.google.com/codelabs/google-maps-in-flutter/#4
我已经完成了该指南中的所有步骤,并且可以在我的项目中看到名为Runner.xcworkspace
的文件(使用android studio),但是仍然出现此错误。
Runner.xcworkspace
中的文件如下:
Runner.xcworkspace
-> xcshareddata
-> WorkspaceSettings.xcsettings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
答案 0 :(得分:0)
我也有同样的问题。我找到了Flutter自己的示例Github存储库,它有助于解决问题。
https://github.com/flutter/samples/tree/master/flutter_maps_firestore
然后在Runner / AppDelegate.m中使用您自己的API密钥将代码更改为以下代码。
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// TODO: Replace this with an API key that has Google Maps for iOS enabled
// See https://developers.google.com/maps/documentation/ios-sdk/get-api-key
[GMSServices provideAPIKey: @"ADD_A_KEY_HERE"];
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
要添加Firestore支持,您将需要在Firebase上进行操作,然后添加自己的Runner/GoogleService-Info.plist