title: Why to fix "Frameworks/Flutter.framework: Permission denied" while building iOS native app with flutter module?
body: <p>I created an iOS single view app (hostapp) and converted it to pod workspace. Runs well.
  Then created flutter module (clientapp), provided iOS team. Runs well, independently.
  Turned off Bitcode for hostapp and clientapp, as it caused other problems.
  Now added clientapp to hostapp via podfile, no internal code changes. After pod install in hostapp, I tried building it. Then it throws <code>/Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/Flutter.framework: Permission denied</code></p>
  
  <ul>
  <li>Both hostapp and clientapp are default iOS and flutter app. No changes whatsoever.</li>
  <li>I followed this official guide <a href="https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps" rel="nofollow noreferrer">https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps</a>.</li>
  <li>Have tried to search for similar issue but no success there.</li>
  <li>Tested on Xcode 10 and 11</li>
  <li>Tried legacy build</li>
  <li>Tried Xcode 11, 10, 9.3-compatible, etc</li>
  <li>Changed flutter chmod to 777</li>
  <li>Changed <code>/Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/</code> chmod to 777</li>
  </ul>
  
  <pre><code>PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Intermediates.noindex/hostapp.build/Debug-iphonesimulator/hostapp.build/Script-4899A4A5D85C0D737A68EFD6.sh (in target 'hostapp' from project 'hostapp')
      cd /Users/iVoIP/projects/xcode/hostapp
      /bin/sh -c /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Intermediates.noindex/hostapp.build/Debug-iphonesimulator/hostapp.build/Script-4899A4A5D85C0D737A68EFD6.sh
  
  mkdir -p /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks
  rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/iVoIP/projects/xcode/hostapp/Pods/../../clientapp/.ios/Flutter/engine/Flutter.framework" "/Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks"
  building file list ... done
  Flutter.framework/
  Flutter.framework/Flutter
  Flutter.framework/Info.plist
  Flutter.framework/icudtl.dat
  Flutter.framework/_CodeSignature/
  Flutter.framework/_CodeSignature/CodeResources
  
  sent 94440038 bytes  received 120 bytes  188880316.00 bytes/sec
  total size is 94428117  speedup is 1.00
  Stripped /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/Flutter.framework/Flutter of architectures: armv7 arm64
  Code Signing /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/Flutter.framework with Identity -
  /usr/bin/codesign --force --sign -  --preserve-metadata=identifier,entitlements '/Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/Flutter.framework'
  /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/Flutter.framework: replacing existing signature
  /Users/iVoIP/Library/Developer/Xcode/DerivedData/hostapp-czxdwjjefjvrnhhdvbmaqeczngbh/Build/Products/Debug-iphonesimulator/hostapp.app/Frameworks/Flutter.framework: Permission denied
  Command PhaseScriptExecution failed with a nonzero exit code
  </code></pre>