Having trouble building a Flutter app targeting iOS. The issue came up out of the blue. The only big difference during the development cycle is the account owner had to accept new terms in the Apple Developer portal. A colleague can still build the app and publish to builds for TestFlight, but they were not actively developing during the time. It’s clearly a "me" problem.
Issue as reported during any sort of build:
Failed to codesign /ugly-path-to-app with identity REDACTEDABC123YOUANDME
Things I’ve tried that didn’t work.
- cleaned the builds both via CLI and within xcode.
- manually downloaded certificates
- revoked and reissued certificates
- rebooted
- granted access to ALL (will be undoing this) to the keys within keychain.
- hopped on one foot counter-clockwise while burning incense.
I don’t think the certificates or access them is the problem. Taking the identity REDACTEDABC123YOUANDME
and exercising it on the command line with the following command works:
codesign --force --sign REDACTEDABC123YOUANDME test.txt
And there’s no keychain prompt. Running the command repeatedly tells me the file has been resigned and changing the identity to be something invalid, of course, fails.
At a loss here and short of trying to uninstall and reinstall xcode to fix this I don’t know what else to try.
In the title, but:
xcode 14.2
Flutter 3.7.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c07f788888 (4 months ago) • 2023-02-22 17:52:33 -0600
Engine • revision 0f359063c4
Tools • Dart 2.19.2 • DevTools 2.20.1
Flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.5, on macOS 12.6.3 21G419 darwin-arm64, locale en-US)
[✓] Android toolchain – develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode – develop for iOS and macOS (Xcode 14.2)
[✓] Chrome – develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Community Edition (version 2023.1)
[✓] VS Code (version 1.79.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
I can provide more information as necessary, but as of now I’m somewhat stuck.
2
Answers
Ok, so 12 hours later it mostly righted itself. I performed the following steps both times but it worked the second, but I'll enumerate them here. If this helps someone, let me know and I'll accept my own answer. And if someone can either explain or confirm MacOS and XCode do some form of certificate caching I missed (would be the only thing that makes sense as the steps were the same).
flutter clean
.rm -rf ~/Library/Developer/Xcode/DerivedData
flutter pub get
from the CLI.ios
directory and ran pod install.At this point, everything was probably fixed, but I ran the following steps again.
flutter build ios --debug --flavor=Runner
Now these are, again, the same steps I ran twice before and the only thing which makes sense, to me, is that there was some maintenance window at which I performed some specific action at exactly the wrong time that put me in this no-man's land. Of course, there's the other option that something else was going on entirely.
Either way, I'm not a fan of stuff just starting to work so if anyone has any ideas please let me know what you believe them to be.
And if this helps anyone, let me know that as well.
Hi @andymeadowns this issue believe is related to this stack. I was having the same problem and fixed building the project on external disk without cloud backing up.
https://stackoverflow.com/users/78429/andymeadows