Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: iOS Build Time Exceeds Expected Duration (Shorebird Release) #2693

Open
omar-hanafy opened this issue Dec 17, 2024 · 11 comments
Open

fix: iOS Build Time Exceeds Expected Duration (Shorebird Release) #2693

omar-hanafy opened this issue Dec 17, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@omar-hanafy
Copy link

App ID:
Org: 2070


Description

The iOS app build process using Shorebird is taking an unusually long time to complete. The build time exceeds expected durations, reaching over 50 minutes without completion. This significantly impacts productivity and delays releases.


Steps To Reproduce

  1. Run the command shorebird release ios in the terminal.
  2. Monitor the build process time in the terminal output.
  3. Observe that the process continues for an extended duration (e.g., > 3000 seconds).

Expected Behavior

The iOS build process should complete within a reasonable time frame (e.g., under 15-20 minutes) for an app of this size and complexity.


Screenshots

  • Screenshot 1: Terminal showing the build process stuck at Building app bundle... for over 3100 seconds.

Additional Context

  • Flutter Version: 3.27.0
  • Tool Used: Shorebird
  • Device: MacBook Pro M2 Pro
  • The issue occurs consistently during iOS builds, while other builds (e.g., Android) complete within acceptable time limits.
  • Network and system resource usage appear normal during the build process.

image

@omar-hanafy omar-hanafy added the bug Something isn't working label Dec 17, 2024
@omar-hanafy
Copy link
Author

Update:
build exceeded 4000s and I terminated it, shorebird doctor output:

CleanShot 2024-12-17 at 12 00 27@2x

@bryanoltman
Copy link
Contributor

@omar-hanafy Can you try running shorebird release ios -v (same command, but with the verbose flag) and let us know what command it's getting stuck on?

@pro100svitlo
Copy link

pro100svitlo commented Dec 17, 2024

@bryanoltman this looks strange to me:

✓ Downloading xcarchive (100%) (3.8s)
No checksum provided for patch, skipping file corruption validation
No checksum provided for aot-tools.dill, skipping file corruption validation
[Process.run] git for-each-ref --contains 8709ea6fca468217fb2d962a3b876268601b62b7 --format %(refname:short) refs/remotes/origin/flutter_release/* (in /Users/andrii.antonov/.shorebird/bin/cache/flutter/8709ea6fca468217fb2d962a3b876268601b62b7)
[Process.run] git for-each-ref --contains 8709ea6fca468217fb2d962a3b876268601b62b7 --format %(refname:short) refs/remotes/origin/flutter_release/* (in /Users/andrii.antonov/.shorebird/bin/cache/flutter/8709ea6fca468217fb2d962a3b876268601b62b7)
Exited with code 0
stdout:
origin/flutter_release/3.24.4
Exited with code 0
stdout:
origin/flutter_release/3.24.4
[Process.start] /Users/andrii.antonov/.shorebird/bin/cache/flutter/8709ea6fca468217fb2d962a3b876268601b62b7/bin/flutter build ipa --release --flavor=dev --target=lib/new_app/main.dart --verbose

after that build stuck

@bryanoltman
Copy link
Contributor

Hmm, that's really surprising. It'd be great to dig in a little further, if you don't mind. Could you try running:

FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev /Users/andrii.antonov/.shorebird/bin/cache/flutter/8709ea6fca468217fb2d962a3b876268601b62b7/bin/flutter build ipa --release --flavor=dev --target=lib/new_app/main.dart --verbose

I'd be curious which step this gets stuck on (or if it's failing in an odd way that we aren't detecting)

@pro100svitlo
Copy link

Here are some final lines from that cmd:

       [✓] App Settings Validation

[ ] • Version Number: 5.7.3.dev
[ ] • Build Number: 2281
[ ] • Display Name: App[D]
[ ] • Deployment Target: 14.0
[ ] • Bundle Identifier: bundle.dev
[ ]
[!] App Icon and Launch Image Assets Validation
[ ] ! App icon is set to the default placeholder icon. Replace with unique icons.
[ ] ! Launch image is set to the default placeholder icon. Replace with unique launch image.
[ ]
To update the settings, please refer to https://flutter.dev/to/ios-deploy

[ ] Building App Store IPA...
[ +1 ms] executing: /usr/bin/arch -arm64e xcrun xcodebuild -exportArchive -allowProvisioningDeviceRegistration -allowProvisioningUpdates
-archivePath /Users/andrii.antonov/dev/app/mobile-app/app/build/ios/archive/Runner.xcarchive -exportPath
/Users/andrii.antonov/dev/app/mobile-app/app/build/ios/ipa -exportOptionsPlist
/var/folders/sy/m0g5rgqs08x_f9zfzf9nbz5h0000gq/T/flutter_tools.7dkjF8/flutter_build_ios.tc5qhk/ExportOptions.plist
[+73012 ms] Exported dev to: /Users/andrii.antonov/dev/app/mobile-app/app/build/ios/ipa
** EXPORT SUCCEEDED **

                2024-12-17 21:29:21.309 xcodebuild[71658:16000875] [MT] IDEDistribution: -[IDEDistributionLogging
                _createLoggingBundleAtPath:]: Created bundle at path
                "/var/folders/sy/m0g5rgqs08x_f9zfzf9nbz5h0000gq/T/dev_2024-12-17_21-29-21.296.xcdistributionlogs".

[ +4 ms] Building App Store IPA... (completed in 73.0s)
[ ] ✓ Built IPA to build/ios/ipa (44.0MB)
[ ] To upload to the App Store either:
[ ] 1. Drag and drop the "build/ios/ipa/.ipa" bundle into the Apple Transporter macOS app
https://apps.apple.com/us/app/transporter/id1450874784
[ ] 2. Run "xcrun altool --upload-app --type ios -f build/ios/ipa/
.ipa --apiKey your_api_key --apiIssuer your_issuer_id".
[ ] See "man altool" for details about how to authenticate with the App Store Connect API key.
[ ] "flutter ipa" took 291,498ms.
[ ] ensureAnalyticsSent: 0ms
[ ] Running 2 shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 0

@omar-hanafy
Copy link
Author

@bryanoltman

Hi,
I followed your suggestion and ran shorebird release ios -v with the verbose flag. Interestingly, the issue didn’t happen again—it worked perfectly this time. My MacBook Pro also restarted before this attempt, so it’s possible that a restart or a temporary network issue may have resolved the problem.

Thank you for your support! I’ll keep an eye on it, and if it happens again, I’ll share the verbose output for further debugging.

@bryanoltman
Copy link
Contributor

Great! Glad the issue was resolved

@pro100svitlo
Copy link

pro100svitlo commented Dec 18, 2024

@bryanoltman can you please reopen the issue?
I have similar issue, but with patching. and restarting the laptop did not help (neither cleaning cache or other)

@bryanoltman
Copy link
Contributor

Ah, sorry about that!

@bryanoltman bryanoltman reopened this Dec 18, 2024
@pro100svitlo
Copy link

@bryanoltman thank you 🙏
So, do you know why it might take ages to create a patch?

p.s. I never waited that long... I was waiting maximum for 1k seconds +-

@eseidel eseidel added this to 1.1 Dec 20, 2024
@eseidel eseidel moved this to Todo in 1.1 Dec 20, 2024
@eseidel
Copy link
Contributor

eseidel commented Dec 20, 2024

Shorebird will be out for US holidays next week. We would love to help, but we'll have to follow up after that. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

4 participants