-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Reproduction steps:
$ flutter create test_build_configuration
$ cd test_build_configuration
$ open ios/Runner.xcworkspace
In Xcode:
File > New > Target > watchOS > Intents Extension > Any name > Activate
Add development team
Build new extension scheme
Ld /Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Intermediates.noindex/Runner.build/Debug-watchos/Anything.build/Objects-normal/armv7k/Binary/Anything normal armv7k (in target 'Anything' from project 'Runner')
cd /Users/m/Projects/test_build_configuration/ios
/Users/m/Applications/Xcode-11-4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target armv7k-apple-watchos6.2 -isysroot /Users/m/Applications/Xcode-11-4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.2.sdk -L/Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Products/Debug-watchos -F/Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Products/Debug-watchos -filelist /Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Intermediates.noindex/Runner.build/Debug-watchos/Anything.build/Objects-normal/armv7k/Anything.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -Xlinker -rpath -Xlinker @executable_path/../../../../Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Intermediates.noindex/Runner.build/Debug-watchos/Anything.build/Objects-normal/armv7k/Anything_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -fapplication-extension -framework Flutter -e _NSExtensionMain -Xlinker -dependency_info -Xlinker /Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Intermediates.noindex/Runner.build/Debug-watchos/Anything.build/Objects-normal/armv7k/Anything_dependency_info.dat -o /Users/m/Library/Developer/Xcode/DerivedData/Runner-gqrdmqfcslfkfmftjruzfuvvhszh/Build/Intermediates.noindex/Runner.build/Debug-watchos/Anything.build/Objects-normal/armv7k/Binary/Anything
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Additionally, adding a non-Flutter target may succeed, but still incorrectly links on Flutter.
The problems seems to be that the watch and watch extension targets inherit the linker flags from "ios/Flutter/Generated.xcconfig", which sets
OTHER_LDFLAGS=$(inherited) -framework Flutter. Consequently the link fails, because these targets do not contain the flutter framework. Currently it is fixed by settingOTHER_LDFLAGS=""for the watch and watch extension targets, though it would be more convenient if this manual adjustment is not necessary. As this setting seems to be a side effect of fixing #50568 , do you have some insight if this setting could be limited to the Runner target?
The Runner project should not set a base configuration since the generated Flutter build settings (particularly linker flags) should not pollute other targets. The Runner target (and any test targets) should use the base configuration.

