You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to build iOS app after modifying pubspec.yaml and running flutter pub get #42956
I've just verified that calling flutter build bundle from the commandline isn't necessary, just editing the pubspec.yaml is enough to create the problem.
[ +7 ms] [✓] Flutter (Channel master, v1.10.15-pre.136, on Mac OS X 10.14.6 18G95, locale en-US)
[ ] • Flutter version 1.10.15-pre.136 at /Users/aaclarke/dev/flutter
[ ] • Framework revision 357d02c87b (2 days ago), 2019-10-15 15:33:55 -0700
[ ] • Engine revision 540fc977bb
[ ] • Dart version 2.6.0 (build 2.6.0-dev.7.0 70a7ef3f58)
changed the title [-]XCode unable to build after running "build bundle" in module[/-][+]Unable to build iOS app after modifying pubspec.yaml and running flutter pub get[/+]on Nov 5, 2019
$ flutter create -t module test_module_pubspec
$ cd test_module_pubspec
$ flutter build ios
$ ls -la .ios/Flutter/engine/
total 8
drwxr-xr-x 4 m primarygroup 128 Nov 4 16:53 .
drwxr-xr-x 10 m primarygroup 320 Nov 4 16:53 ..
drwxr-xr-x 8 m primarygroup 256 Nov 4 16:53 Flutter.framework
-rw-r--r-- 1 m primarygroup 758 Nov 4 16:53 Flutter.podspec
$ open pubspec.yaml
Increment version:
$ flutter pub get
$ ls -la .ios/Flutter/engine/
ls: .ios/Flutter/engine/: No such file or directory
The simple approach would be to repopulate the framework in .ios/Flutter/engine/ based on whatever existed there previously (perhaps by leaving a record of what mode before deleting it).
However, these is still the fact that building the module project seems to depend on the last build command run. There should be a better way to do this, though it might require changes in how the module project is generated.
However, these is still the fact that building the module project seems to depend on the last build command run. There should be a better way to do this, though it might require changes in how the module project is generated.
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 -v and a minimal reproduction of the issue.
Activity
gaaclarke commentedon Oct 17, 2019
cc @jmagman
gaaclarke commentedon Oct 17, 2019
I've just verified that calling
flutter build bundlefrom the commandline isn't necessary, just editing the pubspec.yaml is enough to create the problem.[-]XCode unable to build after running "build bundle" in module[/-][+]Unable to build iOS app after modifying pubspec.yaml and running flutter pub get[/+]jmagman commentedon Nov 5, 2019
flutter pub getseems to the be the command removing the directory.ios/Flutter/engineafter pubspec.yaml is modified.jmagman commentedon Nov 5, 2019
Simplified reproduction steps:
Increment
version:jmagman commentedon Nov 5, 2019
When the pubspec changes, the ephemeral directory is deleted and re-created from the template:
flutter/packages/flutter_tools/lib/src/project.dart
Line 450 in 175b372
jmagman commentedon Nov 5, 2019
That framework isn't present when the module is first created, either.
Whenever the pubspec changes, this will reproduce. The workaround is to:
flutter build iosin the module.pod installin the host.jonahwilliams commentedon Dec 2, 2019
The simple approach would be to repopulate the framework in
.ios/Flutter/engine/based on whatever existed there previously (perhaps by leaving a record of what mode before deleting it).However, these is still the fact that building the module project seems to depend on the last build command run. There should be a better way to do this, though it might require changes in how the module project is generated.
jonahwilliams commentedon Dec 2, 2019
(I'm also not sure if that fixes having to run pod install)
jmagman commentedon Dec 2, 2019
The framework is only copied during
pod installso the plugins have something to link against beforexcode_backendscript is run, which copies the version of the engine based on the Xcode run's$(CONFIGURATION)build setting (Debug, Profile, Release)https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.sh#L65
So it shouldn't matter what the last build command was because the current configuration is what will be copied and embedded into the app.
jonahwilliams commentedon Dec 3, 2019
Good to know. In that case it sounds like we could always copy the debug framework when recreating the ephemeral directory and this would "just work"?
jmagman commentedon Dec 3, 2019
It should, see my PR at #37450. That test didn't pass though and I got distracted with the Xcode rename problem.
github-actions commentedon Aug 25, 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.