Can't Get Past Code Signing Error When Building Flutter App

Hi,

I developed a Flutter app that works well in the iOS simulator, but that fails to deploy on my physical iPhone 13 Pro Max. Here is the error I get:

Target debug_unpack_ios failed: Exception: Failed to codesign /Users/<username>/Library/Developer/Xcode/DerivedData/Runner-<redacted>/Build/Products/Debug-iphoneos/Flutter.framework/Flutter with identity <redacted>

I've followed all the instructions that I found online, like moving my project from cloud storage to my local hard drive, but nothing has worked.

Thank you so much for your help!

Answered by DTS Engineer in 832939022

I talk about this in Resolving errSecInternalComponent errors during code signing. It links to another post, Fixing an untrusted code signing certificate, that specifically addresses the unable to build chain to self-signed root for signer issue.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I can’t help you with third-party tools and libraries, so in situations like this I recommend that you create a small test project in Xcode, directly from the iOS > App template. Build that and run it on the simulator, just to make sure the project is set up correctly. Then try getting it to run your device.

If that fails then your issue is on the Apple side of things, and I can help you out there. If it works but your main app still fails, that’s something to escalate via the support channel for that tooling.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It's definitely an Apple code signing issue. I connected my phone to my mac with a cable and created a brand new test project. I ran it on the simulator and it ran and showed hello world. When tried to run it on my phone, it errored (Command CodeSign failed with a nonzero exit code). If you would please help me debug code signing, I would really appreciate it. Thanks!

And my test project was as you said, created from the ios App template. There was no 3rd party code.

my test project was as you said, created from the ios App template.

Cool.

The error you posted is a summary of the problem. You can learn more by looking at the build transcript. For info on how to do that, see Command [something] failed with a nonzero exit code.

You might be able to figure it out just from that but, if not, post the transcript of the code signing step here and I’ll take a look.

ps Use a code block for preformatted text. See tip 5 in Quinn’s Top Ten DevForums Tips.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I see the whole error now, thanks to your instructions, but i still don't understand it/know how to fix it:

CodeSign /Users/mjw/Library/Developer/Xcode/DerivedData/test3-fplwbgvlqthlalgvxynxjlnmsemc/Build/Products/Debug-iphoneos/test3.app/test3.debug.dylib (in target 'test3' from project 'test3') cd /Users/mjw/Documents/Projects/Current/test2/test3

Signing Identity:     "Apple Development: Full Name (V6775UBEAS)"
Provisioning Profile: "iOS Team Provisioning Profile: *"
                      (982489b4-4832-4f77-8246-e8b1ea49eff1)

/usr/bin/codesign --force --sign 6411F4C28E0E1A991FBFE8E1F1A89B77B589EC21 --timestamp\=none --generate-entitlement-der /Users/mjw/Library/Developer/Xcode/DerivedData/test3-fplwbgvlqthlalgvxynxjlnmsemc/Build/Products/Debug-iphoneos/test3.app/test3.debug.dylib

Warning: unable to build chain to self-signed root for signer "Apple Development: Full Name (V6775UBEAS)" /Users/mjw/Library/Developer/Xcode/DerivedData/test3-fplwbgvlqthlalgvxynxjlnmsemc/Build/Products/Debug-iphoneos/test3.app/test3.debug.dylib: errSecInternalComponent

I talk about this in Resolving errSecInternalComponent errors during code signing. It links to another post, Fixing an untrusted code signing certificate, that specifically addresses the unable to build chain to self-signed root for signer issue.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Can't Get Past Code Signing Error When Building Flutter App
 
 
Q