'ERROR: Runner.xcworkspace does not exist. error implementing google maps
I'm trying to implement GoogleMaps into my flutter project, it works fine for the android version, but with the iOS version I'm facing some problems.
The error's title says:
Runner.xcworkspace does not exist
This is the guide I'm following: https://codelabs.developers.google.com/codelabs/google-maps-in-flutter/#4
I've done all of the steps in that guide, and I can see the file named Runner.xcworkspace
in my project (using android studio), but still, I'm having this error.
The file inside Runner.xcworkspace
is as below:
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>
Solution 1:[1]
I also had the same problem. I found this sample Github repository by Flutter themselves which helped solve the problem.
https://github.com/flutter/samples/tree/master/flutter_maps_firestore
Then in Runner/AppDelegate.m change the code to the following with your own API key.
#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
To add Firestore support you will need to follow the process on Firebase and then add your own Runner/GoogleService-Info.plist
Solution 2:[2]
You probably need to be running Xcode on mac to be able to get these files.
Runner.xcworkspace contains the 'appid' which can only be gotten when using Xcode
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Cameron |
Solution 2 | Leo Sammy |