Repository navigation
Flutter hangs in xcodebuild -showBuildSettings when building for iOS (v1.7.8+hotfix.3) #35988
Description
Building our Flutter app will hang about 20% of the time using the following command:
flutter build ios --release --no-codesign -t lib/main.dart
Android builds do not exhibit this behavior.
The last output we see is something like:
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building ws.flea.Fleaflicker for device (ios-release)...
Each build is executed from an identical clean environment.
Steps to Reproduce
Behavior is not reproducible every time. The current workaround is to retry the build (in a clean environment) which eventually succeeds.
Our build script is not much more complex than this (adapted from here):
git clone https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel stable
flutter doctor
flutter build ios --release --no-codesignI'd be happy to share the codebase and access to our continuous deployment tool (Microsoft AppCenter) with Flutter devs.
+ flutter doctor
Downloading Material fonts... 0.5s
Downloading android-arm-profile/darwin-x64 tools... 0.3s
Downloading android-arm-release/darwin-x64 tools... 0.2s
Downloading android-arm64-profile/darwin-x64 tools... 0.3s
Downloading android-arm64-release/darwin-x64 tools... 0.3s
Downloading android-x86 tools... 1.0s
Downloading android-x64 tools... 1.1s
Downloading android-arm tools... 0.5s
Downloading android-arm-profile tools... 0.3s
Downloading android-arm-release tools... 0.3s
Downloading android-arm64 tools... 0.5s
Downloading android-arm64-profile tools... 0.4s
Downloading android-arm64-release tools... 0.3s
Downloading ios tools... 2.5s
Downloading ios-profile tools... 1.5s
Downloading ios-release tools... 1.1s
Downloading Gradle Wrapper... 0.0s
Downloading package sky_engine... 0.1s
Downloading common tools... 0.5s
Downloading common tools... 0.5s
Downloading darwin-x64 tools... 1.6s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F132, locale en)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✗] iOS tools - develop for iOS devices
✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
[!] Android Studio (not installed)
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
We've observed this behavior since first using Flutter with v1.2.1. We only use the stable channel.
Dart package dependencies we've used since observing this behavior:
shared_preferences
protobuf
http
intl
dynamic_theme
timeago
event_bus
firebase_admob
(Possibly the same issue as described and closed in #28415. cc @eseidelGoogle)
Activity
eseidelGoogle commentedon Jul 11, 2019
@kristiansagi may know if nevercode is seeing this too?
eseidelGoogle commentedon Jul 11, 2019
@xster or @zanderso may have context. Thanks for the report!
xster commentedon Jul 11, 2019
I'm not aware of any changes recently. Can you try
flutter build ios --release --no-codesign --verbose -t lib/main.dartand show us the output?orischwartz commentedon Jul 11, 2019
I am now unable to reproduce the issue with the verbose flag.
Going to close until I can gather more details.
priitlatt commentedon Jul 15, 2019
@eseidelGoogle I can confirm on behalf of @NevercodeHQ / @kristiansagi that we've seen a spike in iOS builds getting stuck since July 9.
flutter build ios ...argsdoes not exit and the last bit of log isSo far we've seen it happening on versions
1.7.8+hotfix.2,1.7.8+hotfix.3,1.8.0,1.8.1-pre.2,1.8.1-pre.22.eseidelGoogle commentedon Jul 15, 2019
Reopening based on @priitlatt's comments.
@jonahwilliams @zanderso does this show up in our analytics?
orischwartz commentedon Jul 15, 2019
I will add a single data point from a build that got stuck with the verbose flag:
[Build got stuck here]
The next line should have been something like:
I will also add that we're seeing these less frequently than before the 1.7 stable release so I don't believe this is the same issue as #28415
zanderso commentedon Jul 15, 2019
Looks like it's the invocation here that is hanging: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/macos/cocoapods.dart#L197. @stuartmorgan could you take a look?
stuartmorgan-g commentedon Jul 15, 2019
I'm a bit confused; @orischwartz has log output that's stuck in a different place than @priitlatt. The bug was re-opened based on the former, but the last comment is focusing on the latter.
Do we have reason to believe the two cases are related even though the location where the build stopped is different?
29 remaining items
priitlatt commentedon Sep 4, 2019
I've scraped some usage statistics from @codemagic-ci-cd and still see that small fraction of builds do not get past the
xcodebuild -showBuildSettingson the first run, even when built with Flutter 1.9.7+.What we see is something like
At this point the build hangs, and at the same time
Flutter doctor output on this environment was
zanderso commentedon Sep 4, 2019
Hi @priitlatt, #39579 is in review, which will add a timeout/retry to the
-showBuildSettingsinvocation that is still hanging.zanderso commentedon Sep 5, 2019
#39579 has landed on master.
orischwartz commentedon Sep 9, 2019
@zanderso does
v1.10.1-pre.41have the fix?Had a build hang today from
masterchannel^^ build killed after hanging for ~25 minutes.
MisterJimson commentedon Sep 10, 2019
Just for anyone coming to this thread to know if it was fixed by the stable update yesterday, it was not. Still seeing this on stable v1.9.1+hotfix.2.
zanderso commentedon Sep 10, 2019
@orischwartz Apologies for the churn and delay. The previous change was included in
v1.10.1-pre.41, but I introduced a bug in the process timeout logic by using a mock for testing that didn't properly simulate a timing out process. I've sent #40159 to fix that issue. Thanks again for your patience.zanderso commentedon Sep 11, 2019
#40159 has landed on master.
orischwartz commentedon Sep 12, 2019
👍 Haven't had a build hang yet, 9 consecutive attempts. We've never had more than 4 consecutive builds succeed. Not sure if that's statistically significant but as far as I'm concerned this fixes the original issue I reported. Thanks!
zanderso commentedon Sep 12, 2019
Glad to hear it! I will close this issue, but please feel free to re-open if you see the same thing again.
orischwartz commentedon Sep 13, 2019
@zanderso Any chance that #39899 introduced a regression that reverted the fix?
I've had two builds hang since then. All of the successful builds yesterday were before that commit.
Also possible that I spoke too soon but it really seemed like it was fixed on yesterday's master.
zanderso commentedon Sep 16, 2019
There was a remaining synchronous (blocking) call without a timeout. I've removed it in #40435.
github-actions commentedon Aug 28, 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.