Repository navigation
Must run flutter clean before building when iOS app has watch extension, Failed to extract arm64 for .../PlugIns/WatchApp.appex/Frameworks #60351
Copy link
Copy link
Labels
c: fatal crashCrashes that terminate the processCrashes that terminate the processplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Problem
Must run flutter clean between every build (run/debug) when app includes a WKExtension.
Seems like flutter uses the same "active architecture" for Apple Watch as it does for iPhone.
That in turn causes flutter to try extract the wrong architecture when building app for debug/run on device.
Steps to Reproduce
- Run
flutter create bug. - Add a watch extension (https://flutter.dev/docs/development/platform-integration/apple-watch
- Add a pod for your watch extension target (I use
pod 'EFQRCode/watchOS', '~> 5.1.6', but any pod will do) - Run your app on an iPhone or iOS simulator.
- Stop debug/run session after app has installed and launched on device/simulator.
- Again, run your app on an iPhone or iOS simulator.
Expected results:
App launches.
Actual results:
Build error.
Logs
Flutter.framework/_CodeSignature/CodeResources
sent 98388907 bytes received 120 bytes 65592684.67 bytes/sec
total size is 98376483 speedup is 1.00
PATH/TO/BUILD/Runner.app/Frameworks/App.framework/App: signed bundle with Mach-O universal (x86_64 arm64) [io.flutter.flutter.app]
PATH/TO/BUILD/Runner.app/Frameworks/Flutter.framework/Flutter: replacing existing signature
PATH/TO/BUILD/Runner.app/Frameworks/Flutter.framework/Flutter: signed bundle with Mach-O universal (armv7 x86_64 arm64) [io.flutter.flutter]
fatal error: lipo: -extract arm64 specified but fat file: PATH/TO/BUILD/Runner.app/Watch/APP_NAME.app/PlugIns/WatchApp_staging Extension.appex/Frameworks/EFQRCode.framework/EFQRCode does not contain that architecture
Failed to extract arm64 for PATH/TO/BUILD/Runner.app/Watch/APP_NAME.app/PlugIns/WatchApp_staging Extension.appex/Frameworks/EFQRCode.framework/EFQRCode. Running lipo -info:
Architectures in the fat file: PATH/TO/BUILD/Runner.app/Watch/APP_NAME.app/PlugIns/WatchApp_staging Extension.appex/Frameworks/EFQRCode.framework/EFQRCode are: armv7k arm64_32
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
[✓] Flutter (Channel beta, 1.19.0-4.2.pre, on Mac OS X 10.15.5 19F101, locale en-NO)
• Flutter version 1.19.0-4.2.pre at /Users/ME/Documents/Development/FLUTTER_SDK/flutter
• Framework revision 9b9b543d92 (4 days ago), 2020-06-22 12:19:28 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/ME/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• 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-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.46.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (4 available)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: fatal crashCrashes that terminate the processCrashes that terminate the processplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
[-]Must run flutter clean before building when iOS app has WKExtension[/-][+]Must run flutter clean before building when iOS app has watch extension, Failed to extract arm64 for .../PlugIns/WatchApp.appex/Frameworks[/+]jmagman commentedon Jul 14, 2020
Can we get your
ios/Podfile?jmagman commentedon Aug 4, 2020
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
Henrik-glt commentedon Aug 25, 2020
@jmagman From regenerated and updated Podfile (Flutter version 1.20.2).
The problem still persists.
The workaround I currently use is to comment out lines 219 & 227 in packages/flutter_tools/bin/xcode_backend.sh to avoid "crashing" the build.
jmagman commentedon Aug 28, 2020
Reverted at #64829
github-actions commentedon Aug 12, 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.