How to force Flutter to use new developer certificate?

5,043

Solution 1

Run flutter config to see your current settings and a certificate choice applied.

To clear the choice according to the documentation you can run:

flutter config --clear-ios-signing-cert.

--clear-ios-signing-cert Clear the saved development certificate choice used to sign apps for iOS device deployment.

Flutter 2.0.5.

Solution 2

I think check this file vim ~/.flutter_settings will be well.

{
  "ios-signing-cert": "Apple Development: [email protected] (XXXXXXXX)",
  "enable-macos-desktop": true
}

Solution 3

I had a very similar issue a couple months ago. It took me several hours and basically I had to sign out of and then sign back into XCode:

XCode->Preferences->Accounts

Completely sign out of any accounts and then sign back in with the newest one.

Solution 4

Use

flutter clean

in the terminal. When will clear the selected certificate and will present a choice to you next time you run you code

Share:
5,043
iProgram
Author by

iProgram

Updated on November 30, 2022

Comments

  • iProgram
    iProgram over 1 year

    I am currently developing an application with Flutter. I used to be able to run the code directly using VS code or the command flutter run. Ever since I revoked my developer certificate and generated a new one, the above options when executed, the app crashes on my iPhone. If, however, I run it on the simulator, it works as expected.

    I suspect that this is due to the change in certificates. Xcode says my app is signed with the certificate B39****** where as flutter run says it is signing with 578*******

    I have even tried flutter config --clear-ios-signing-cert as well as flutter upgrade and it still signs with 578.

    How can I force flutter to sign my app with the new certificate? Currently, this means I cannot use the hot reload feature on my physical devices.

  • Jimmy
    Jimmy almost 4 years
    Where can is this file located (I suppose it's somewhere in the flutter sdk but I can't find it)
  • mgalgs
    mgalgs over 2 years
    ~/.flutter_settings doesn't exist on my system... Did it move? Where is this documented?