【问题标题】:ERROR: Runner.xcworkspace does not exist. error implementing google maps错误:Runner.xcworkspace 不存在。执行谷歌地图时出错
【发布时间】:2019-11-23 12:48:12
【问题描述】:

我正在尝试在我的 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>

【问题讨论】:

标签: ios swift google-maps flutter dart


【解决方案1】:

我也遇到了同样的问题。我通过 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-05
    • 2016-11-24
    相关资源
    最近更新 更多