Opening a Flutter app in Xcode should open Runner.xcworkspace, not Runner.xcodeproj.
See https://flutter.dev/docs/deployment/ios#create-a-build-archive and https://github.com/flutter/flutter/issues/10770
User report from @kinex at https://github.com/FirebaseExtended/flutterfire/issues/1258#issuecomment-566964687
I had opened it from VS Code by right-clicking in the explorer MyApp / ios folder and then selecting Open in Xcode. Apparently it opens Runner.xcodeproj because if I now open Runner.xcworkspace directly, I can create an archive normally. Not sure is there some reason that VS Code opens .xcodeproj or is that something that should be fixed.
I wasn't able to reproduce this myself due to https://github.com/Dart-Code/Dart-Code/issues/2178.
Logic at
https://github.com/Dart-Code/Dart-Code/blob/699c291b3f6424753ffde81ba7724e04fcb25c70/src/extension/commands/open_in_other_editors.ts#L54 looks right to me, but I'm not sure what version @kinex is on.
I have VS Code version 1.41.0 / Flutter extension version 3.7.1
I am not so familiar with TypeScript, but should that be
.sort((f1, f2) => f1.name.endsWith(".xcworkspace") ? -1 : 1);
Good catch! I guess I didn't properly verify which one was opening when I did this 馃檲
Thanks!
Most helpful comment
Good catch! I guess I didn't properly verify which one was opening when I did this 馃檲
Thanks!