iosdartflutter

Codesign error with Flutter on iOS


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?


Solution

  • 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!