-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toola: desktopRunning on desktopRunning on desktopa: first hourThe first hour of using FlutterThe first hour of using Flutterplatform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-iosiOS applications specificallyiOS applications specificallyplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Steps to reproduce
- On an M1 Mac...
- Clone the repo at https://github.com/wmleler/thematrix
- Enable macos for the project by running
flutter create --platforms=macos . - Ensure that macos is enabled by running
flutter config --enable-macos-desktop - Install Cocoapods from scratch using
sudo gem install cocoapods(as instructed by https://guides.cocoapods.org/using/getting-started.html#installation, which is pointed to byflutter doctor) - Attempt to run the app using
flutter run -d macos
Expected behavior
You expect the app to run (it's out of date and has errors after running, but it still should be able to run).
Actual behavior
You get an error building. The main error is:
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi/library.rb:275: [BUG] Bus Error at 0x00000001042fc000
Googling for that error will eventually lead you to CocoaPods/CocoaPods#10723 (comment)
So then, you run:
sudo arch -x86_64 gem install ffi
But when you run the app again, you still get the same error.
It turns out that you can get it working by applying the following patch to flutter_tools:
diff --git a/packages/flutter_tools/lib/src/macos/cocoapods.dart b/packages/flutter_tools/lib/src/macos/cocoapods.dart
index 8e7a08f62c..c0ce393d03 100644
--- a/packages/flutter_tools/lib/src/macos/cocoapods.dart
+++ b/packages/flutter_tools/lib/src/macos/cocoapods.dart
@@ -311,7 +311,7 @@ class CocoaPods {
Future<void> _runPodInstall(XcodeBasedProject xcodeProject, BuildMode buildMode) async {
final Status status = _logger.startProgress('Running pod install...');
final ProcessResult result = await _processManager.run(
- <String>['pod', 'install', '--verbose'],
+ <String>['arch', '-x86_64', 'pod', 'install', '--verbose'],
workingDirectory: _fileSystem.path.dirname(xcodeProject.podfile.path),
environment: <String, String>{
// See https://github.com/flutter/flutter/issues/10873.... but presumably we shouldn't be unconditionally running that.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toola: desktopRunning on desktopRunning on desktopa: first hourThe first hour of using FlutterThe first hour of using Flutterplatform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-iosiOS applications specificallyiOS applications specificallyplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.