Skip to content

Must run flutter clean before building when iOS app has watch extension, Failed to extract arm64 for .../PlugIns/WatchApp.appex/Frameworks #60351

@Henrik-glt

Description

@Henrik-glt

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

  1. Run flutter create bug.
  2. Add a watch extension (https://flutter.dev/docs/development/platform-integration/apple-watch
  3. Add a pod for your watch extension target (I use pod 'EFQRCode/watchOS', '~> 5.1.6', but any pod will do)
  4. Run your app on an iPhone or iOS simulator.
  5. Stop debug/run session after app has installed and launched on device/simulator.
  6. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: fatal crashCrashes that terminate the processplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions