14

So I have been trying to get into Flutter recently and I am having issues. When I create a new project and do flutter run it works just fine. If I completely close the application and re-run the app I get this error every time.

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    /Users/zachstarnes/Documents/code/test_proj/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder information, or similar detritus not allowed
    Command /usr/bin/codesign failed with exit code 1
Could not build the application for the simulator.
Error launching application on iPhone X.

I have no idea how to fix this. I tried opening the xcode project file and signing the project to my organization and rerun but that still does not change the outcome. Any ideas of what I need to do to fix this?

Zach Starnes
  • 3,108
  • 9
  • 39
  • 63

9 Answers9

36

So after a long time if finally figured out how to fix it.

The way I was able to fix is to delete the build directory in the root of your flutter project. The folder just gets rebuilt without the files causing the problem.

I assume it has something to do with forking the fonts/images I was adding to the project.

Edit (6/4/2019) You can also use flutter clean and it will also solve the issue. Stated by @Luke Stanyer below!

Zach Starnes
  • 3,108
  • 9
  • 39
  • 63
16

Run

 flutter clean

in your command line.

Luke Stanyer
  • 1,404
  • 12
  • 21
5

For sure flutter clean helps, however, in my case, it was all about setting the Deployment Target to 9.0

enter image description here

Remember to also enable (uncomment or add) this line platform :ios, '9.0' at the top of your ios/Podfile file as long as you don't care about iOS versions below 9.0

Mohamed Mo Kawsara
  • 4,400
  • 2
  • 27
  • 43
4

There can be multiple reasons for this codesign failure.

Go to Keychain Access -> Apple Worldwide Developer Relations Certificate Authority certificate -> Get Info -> (expand) Trust settings

Then for the combo box for "When using this certificate:" make it System Defaults

Nadun Kulatunge
  • 1,567
  • 2
  • 20
  • 28
2

For those who failed and scrolled till this answer, try to download and install the latest certificate from this link:
https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
Before installing this updated certificate delete below certificate from keychain
Apple Worldwide Developer Relations Certification Authority

2

To me what worked was:

  • Open Xcode;
  • Xcode menu > Settings > Accounts;
  • Click on manage certificates;
  • Click on + to Add a new development certificate;

Try to run the App again with Xcode

1

I had this problem and this is what worked for me.

First off, let's just state the obvious, XCode was written to be the IDE version of the Tardis or maybe the Luggage from Terry Pratchett's Discworld series. It's bigger on the inside than it is on the outside and every time you open it you'll be shown something different.

Now, the root problem for me was that my Apple Developer sign in for my project needed to be refreshed. This is how I did that:

  1. Open your Flutter project in XCode.
  2. On top of the left panel there are some icons. One of them looks like a folder. If you hover over it, it will say "Show the Project navigator". Click that.
  3. On left panel below those icons select Runner (should be at the top of a list). This will populate the center panel.
  4. In the center panel, along the left-hand side, you should see a column with Project/Runner and Target/Runner. Select the Runner under Target. This will change the contents in the center panel right-hand side.
  5. Across the top you should now see the following options: General, Signing & Capabilities, Resource Tags, Info, Build Settings, Build Phases, and Build Rules. Select Signing & Capabilities.
  6. If you had the same problem as I had, you will now see prompt in the middle panel section asking you to sign in again and there will be a sign in button right there in the middle of the panel. Click it, sign in with your Apple Developer password.
  7. Now build your project again. You may be prompted by macos to login to grant keychain permissions during the build.

Hopefully this will help some other people.

jwehrle
  • 4,414
  • 1
  • 17
  • 13
0

In my case the code signing has been working. However, one day after some code update in the flutter project, when I tried to rebuild it in Xcode for running on a real iPhone, I was getting the sign failure message. Trie everything suggested (particular flutter clean, as mentioned by many people). Nothing has worked. Here is what worked for me:
Rebuilt your project with a simulator device.

Once I have the project built and ran on simulator, I reconnected the iPhone physical device and it built, code signed and ran again on the physical iPhone device.

Hope it help other who somehow get into the same situation like mine.

us_david
  • 4,431
  • 35
  • 29
0

For those still scrolling and who have their repos on cloud storage, try moving your project from any cloud storage (eg Dropbox, Onedrive, etc.) to local storage. I suspect this is an enhanced security issue?

Oprimus
  • 1,652
  • 3
  • 11
  • 20