Exclude arm64 from iOS app archs if unsupported by plugins (#87244)
This commit is contained in:
@@ -146,6 +146,30 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
|
||||
/// Xcode workspace shared workspace settings file for the host app.
|
||||
File get xcodeWorkspaceSharedSettings => xcodeWorkspaceSharedData.childFile('WorkspaceSettings.xcsettings');
|
||||
|
||||
/// Do all plugins support arm64 simulators to run natively on an ARM Mac?
|
||||
Future<bool> pluginsSupportArmSimulator() async {
|
||||
final Directory podXcodeProject = hostAppRoot
|
||||
.childDirectory('Pods')
|
||||
.childDirectory('Pods.xcodeproj');
|
||||
if (!podXcodeProject.existsSync()) {
|
||||
// No plugins.
|
||||
return true;
|
||||
}
|
||||
|
||||
final XcodeProjectInterpreter? xcodeProjectInterpreter = globals.xcodeProjectInterpreter;
|
||||
if (xcodeProjectInterpreter == null) {
|
||||
// Xcode isn't installed, don't try to check.
|
||||
return false;
|
||||
}
|
||||
final String? buildSettings = await xcodeProjectInterpreter.pluginsBuildSettingsOutput(podXcodeProject);
|
||||
|
||||
// See if any plugins or their dependencies exclude arm64 simulators
|
||||
// as a valid architecture, usually because a binary is missing that slice.
|
||||
// Example: EXCLUDED_ARCHS = arm64 i386
|
||||
// NOT: EXCLUDED_ARCHS = i386
|
||||
return buildSettings != null && !buildSettings.contains(RegExp('EXCLUDED_ARCHS.*arm64'));
|
||||
}
|
||||
|
||||
@override
|
||||
bool existsSync() {
|
||||
return parent.isModule || _editableDirectory.existsSync();
|
||||
|
||||
Reference in New Issue
Block a user