Repository navigation
building for macOS-arm64 but attempting to link with file built for macOS-x86_64 #70566
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 1.24Found to occur in 1.24Found to occur in 1.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-bigsurIssues related to macOS Big SurIssues related to macOS Big Surplatform-macosBuilding 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
- Update your Mac to Big Sur
- Run
flutter create bug - Run
flutter run --releaseand selectmacosas target
Actual results:
flutter run --release
Multiple devices found:
Pixel XL (mobile) • HT6A80200946 • android-arm64 • Android 10 (API 29)
iPhone von Ralph (mobile) • 3fbe4929eec22152a0ffdbaa8c5afef34ebcaafc • ios • iOS 14.0.1
macOS (desktop) • macos • darwin-x64 • macOS 11.0.1 20B29 darwin-x64
Web Server (web) • web-server • web-javascript • Flutter Tools
Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.193
[0]: Pixel XL (HT6A80200946)
[1]: iPhone von Ralph (3fbe4929eec22152a0ffdbaa8c5afef34ebcaafc)
[2]: macOS (macos)
[3]: Web Server (web-server)
[4]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 2
Running "flutter pub get" in foo... 278ms
Launching lib/main.dart on macOS in release mode...
Command CompileSwift failed with a nonzero exit code
ld: warning: ignoring file /Users/ralphbergmann/development/projects/flutter/foo/macos/Flutter/ephemeral/App.framework/App, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/ralphbergmann/development/projects/flutter/foo/macos/Flutter/ephemeral/FlutterMacOS.framework/FlutterMacOS, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FlutterAppDelegate", referenced from:
type metadata for foo.AppDelegate in AppDelegate.o
"_OBJC_CLASS_$_FlutterViewController", referenced from:
objc-class-ref in MainFlutterWindow.o
"_OBJC_METACLASS_$_FlutterAppDelegate", referenced from:
_OBJC_METACLASS_$__TtC3foo11AppDelegate in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
** BUILD FAILED **
Building macOS application...
Exception: Build process failed
flutter doctor -v
[✓] Flutter (Channel master, 1.24.0-8.0.pre.252, on macOS 11.0.1 20B29 darwin-x64, locale de-DE)
• Flutter version 1.24.0-8.0.pre.252 at /Users/ralphbergmann/development/sdks/flutter
• Framework revision bf2c9dfc05 (10 hours ago), 2020-11-14 22:38:02 -0500
• Engine revision 3e77d854a7
• Dart version 2.12.0 (build 2.12.0-45.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at /Users/ralphbergmann/development/sdks/android-sdk
• Platform android-30, build-tools 30.0.1
• ANDROID_HOME = /Users/ralphbergmann/development/sdks/android-sdk
• Java binary at: /Users/ralphbergmann/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.9.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Users/ralphbergmann/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.3)
• IntelliJ at /Users/ralphbergmann/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin installed
• Dart plugin version 202.7319.5
[✓] VS Code (version 1.46.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.12.0
[✓] Connected device (4 available)
• Pixel XL (mobile) • HT6A80200946 • android-arm64 • Android 10 (API 29)
• macOS (desktop) • macos • darwin-x64 • macOS 11.0.1 20B29 darwin-x64
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.193
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 1.24Found to occur in 1.24Found to occur in 1.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-bigsurIssues related to macOS Big SurIssues related to macOS Big Surplatform-macosBuilding 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.
Activity
ralph-bergmann commentedon Nov 15, 2020
When I open
macos\Runner.xcodeprojin Xcode and hit the run button, the app runs.It also runs when I start the app from IntelliJ IDEA.
TahaTesser commentedon Nov 16, 2020
Hi
I can reproduce the issue in release mode only
logs
multiple flutter doctor -v
[✓] Flutter (Channel dev, 1.24.0-7.0.pre, on macOS 11.0.1 20B29 darwin-x64, locale en-GB) • Flutter version 1.24.0-7.0.pre at /Users/tahatesser/Code/flutter_dev • Framework revision a0860f6e87 (2 weeks ago), 2020-10-29 20:07:34 -0700 • Engine revision 073263e39d • Dart version 2.11.0 (build 2.11.0-260.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.2) • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer • Xcode 12.2, Build version 12B45b • CocoaPods version 1.10.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.51.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.16.0 [✓] Connected device (4 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • macOS (desktop) • macos • darwin-x64 • macOS 11.0.1 20B29 darwin-x64 • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.198 • No issues found![✓] Flutter (Channel master, 1.24.0-8.0.pre.252, on macOS 11.0.1 20B29 darwin-x64, locale en-GB) • Flutter version 1.24.0-8.0.pre.252 at /Users/tahatesser/Code/flutter_master • Framework revision bf2c9dfc05 (34 hours ago), 2020-11-14 22:38:02 -0500 • Engine revision 3e77d854a7 • Dart version 2.12.0 (build 2.12.0-45.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.2) • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer • Xcode 12.2, Build version 12B45b • CocoaPods version 1.10.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.51.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.16.0 [✓] Connected device (4 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • macOS (desktop) • macos • darwin-x64 • macOS 11.0.1 20B29 darwin-x64 • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.198 • No issues found!Removing regression label, Big Sur is a new OS and not yet fully supported
1 remaining item
etx commentedon Nov 16, 2020
I can reproduce this on Catalina (10.15.7) with XCode 12.2. Release builds fail but debug builds are building on flutter dev channel.
$ flutter build macos --release
ld: warning: ignoring file /Users/user/flutter/bin/cache/artifacts/engine/darwin-x64-release/FlutterMacOS.framework/FlutterMacOS, building for macOS-arm64 but attempting to link with file built for macOS-x86_64jmagman commentedon Nov 16, 2020
This is a duplicate of #69221. Xcode 12 and up won't be able to build for macOS with
ONLY_ACTIVE_ARCH=NO(profile and release, by default).\cc @stuartmorgan @zanderso
jmagman commentedon Nov 16, 2020
Actually, reopening. From
flutter buildwe can force the valid archs tox86_64until #69221 is done.jmagman commentedon Nov 16, 2020
PR at #70649 will "fix"
flutter build mac --releaseby excluding ARM as a valid architecture. It will still fail with the same error when running in release/archiving in Xcode 12+.GyuriMajercsik commentedon Dec 28, 2020
I wanted to create a MacOS build with Flutter
masterchannel and upload the archive with xCode.Everything worked as expected but I got below errors from Apple so the archive was rejected.
@jmagman , should I create a new ticket or is this related to this issue ?
jmagman commentedon Dec 28, 2020
@GyuriMajercsik different issue. Please file a new one, and any info about the symlinking at those paths would be helpful.
GyuriMajercsik commentedon Dec 28, 2020
thanks @jmagman for the quick response. I filed #73028. Please let me know if I can provide more information.
github-actions commentedon Aug 7, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.