Angel Pineda
Angel Pineda

Reputation: 177

Flutter release in iOS fails, errSecInternalComponent Command PhaseScriptExecution failed with a nonzero exit code

I'm new to flutter/iOS.

I'm using:

Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision 9b2d32b605 • 2021-01-22 14:36:39 -0800 Engine • revision 2f0af37152 Tools • Dart 2.10.5 and Xcode 11.0

Im trying to release a flutter app in iOS. It runs perfectly using xcode or command line (flutter run). But when I execute flutter build ios or try to Product--> archive (in xcode).

I have an error:

Warning: unable to build chain to self-signed root for signer "Apple Development: Jhon Doe (65XXJY9XXX)"
/Users/dev/Library/Developer/Xcode/DerivedData/Runner-cuuvcuiymjgpxmhlfvkgvijzzyls/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/App.framework/App: errSecInternalComponent Command PhaseScriptExecution failed with a nonzero exit code

I tried many ways to solve it, such as: Flutter Clean, pod install, Legacy Build, pod deintegrate, run script only when installing (in Build Pashes), deleting derivedData folder.. with no success.

Any ideas? Please help me, I'm stuck.

Thanks.

Upvotes: 1

Views: 2295

Answers (2)

bahi.elfeky
bahi.elfeky

Reputation: 1

To get rid of this error follow these steps:

-Delete your certificate from the keychain

-Go to your developer account and revoke your certificate

-Go to XCode -> Preferences -> Accounts -> Select the account -> Manage certificate -> Click on the (+) icon -> iOS Development

-Restart your pc

-Open XCode, Clean Build, and Archive.

Upvotes: 0

Leonel Martins
Leonel Martins

Reputation: 2813

I had them same problem and I resolved following the suggestion made here. Im my case, I changed the parameter from embed_and_thin to just embed. So just to be clear, change from

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed_and_thin

to

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed

This is just a workaround until you can upgrade to the latest version (2.0.3 as of 2020-03-24).

Upvotes: 1

Related Questions