Repository navigation
Must run flutter clean before building when iOS app has watch extension, Failed to extract arm64 for .../PlugIns/WatchApp.appex/Frameworks #60351
Description
Activity
- addedplatform-iosiOS applications specificallyiOS applications specificallyc: fatal crashCrashes that terminate the processCrashes that terminate the processt: 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.
on Jun 26, 2020 - changed the title
[-]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[/+]on Jul 14, 2020 Can we get your
ios/Podfile?- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jul 14, 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.
@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.source 'https://cdn.cocoapods.org/' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' ios_deployment_target = '11.0' watchos_deployment_target = '5.0' project 'Runner', { 'Debug' => :debug, 'Release' => :release, 'Profile' => :release, } def parse_KV_file(file, separator='=') file_abs_path = File.expand_path(file) if !File.exists? file_abs_path return []; end generated_key_values = {} skip_line_start_symbols = ["#", "/"] File.foreach(file_abs_path) do |line| next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } plugin = line.split(pattern=separator) if plugin.length == 2 podname = plugin[0].strip() path = plugin[1].strip() podpath = File.expand_path("#{path}", file_abs_path) generated_key_values[podname] = podpath else puts "Invalid plugin specification: #{line}" end end generated_key_values end abstract_target 'AbsPROJECT_NAME' do platform :ios, ios_deployment_target use_frameworks! use_modular_headers! pod 'GoogleIDFASupport' pod 'GoogleTagManager' pod 'Firebase' pod 'FirebaseInAppMessaging' pod 'Firebase/Analytics' target 'Runner' target 'Runner_staging' # Flutter Pod copied_flutter_dir = File.join(__dir__, 'Flutter') copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') unless File.exist?(generated_xcode_build_settings_path) raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" end generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; unless File.exist?(copied_framework_path) FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) end unless File.exist?(copied_podspec_path) FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) end end # Keep pod path relative so it can be checked into Podfile.lock. pod 'Flutter', :path => 'Flutter' # Plugin Pods # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock # referring to absolute paths on developers' machines. system('rm -rf .symlinks') system('mkdir -p .symlinks/plugins') plugin_pods = parse_KV_file('../.flutter-plugins') plugin_pods.each do |name, path| symlink = File.join('.symlinks', 'plugins', name) File.symlink(path, symlink) pod name, :path => File.join(symlink, 'ios') end end abstract_target 'AbsPROJECT_NAMEWatch' do platform :watchos, watchos_deployment_target # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! use_modular_headers! # Pods for Watch App pod 'EFQRCode/watchOS', '~> 5.1.6' target 'WatchApp Extension' target 'WatchApp_staging Extension' end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'YES' end end end `- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Aug 25, 2020 Reverted at #64829
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.- locked as resolved and limited conversation to collaborators
on Aug 12, 2021
Problem
Must run
flutter cleanbetween 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
flutter create bug.pod 'EFQRCode/watchOS', '~> 5.1.6', but any pod will do)Expected results:
App launches.
Actual results:
Build error.
Logs