'Flutter xcode build error File name too long

I tried to build my flutter app in xcode and I got the following error - "File name too long".

I build at command line -

  1. flutter clean
  2. flutter pud get
  3. go into ios folder and run pod install
  4. flutter built ios -v

build is successful and no error found in verbose log. May I know what could be the issue.

/Users/username/Library/Developer/Xcode/DerivedData/Runner- ehbtgfrwszowthgqyvfzuynymnrk/Build/Products/Debug-iphoneos/Runner.app: File name too long
Command CodeSign failed with a nonzero exit code


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source