title: Flutter - FileSystemException: Creation failed flutter_build, permission denied
body: <p>I am trying to run my Flutter app. It worked well before, I don't know what happened but now it just won't launch.</p>
  
  <p>When I try to launch it from Android Studio, I get :</p>
  
  <pre><code>Crash report sent (report ID: [crash id])
  Oops; flutter has exited unexpectedly.
  Crash report written to /home/my_project_path/flutter_07.log;
  please let us know at https://github.com/flutter/flutter/issues.
  </code></pre>
  
  <p>When I try to launch it with <code>flutter run</code> I get the same thing.</p>
  
  <p><code>flutter doctor</code> runs well, and I get no error :</p>
  
  <pre><code>[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Linux, locale fr_FR.UTF-8)
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
  [✓] Android Studio (version 3.6)
  [✓] Connected device (1 available)
  
  • No issues found!
  </code></pre>
  
  <p>The main exception given in the flutter_07.log is :</p>
  
  <p><code>FileSystemException: FileSystemException: Cannot open file, path = '/home/revan/Programs/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.4.0/pubspec.yaml' (OS Error: Permission denied, errno = 13)</code></p>
  
  <p>I tried to <code>sudo chmod 777 /home/revan/Programs/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.4.0/pubspec.yaml</code> and it seemed to work, as when I re-run flutter run, it is another <code>pubspec.yaml</code> file in one of the library in <code>.pub_cache/hosted/pub.dartlang.org</code> that lacks of permission.</p>
  
  <p>I guess I could <code>chmod</code> manually <code>pubspec.yaml</code> of all my 341 libs available in this directory, however it would take a long time and I guess this is not the right method to do it.</p>
  
  <p>Any idea ?</p>
  
  <p>EDIT :
  Okay, so I launched following command :<br>
  <code>sudo find **/pubspec.yaml -type f -exec chmod 644 {} \;</code></p>
  
  <p>It seems to work, as now I have another error :</p>
  
  <p><code>FileSystemException: FileSystemException: Creation failed, path = 'my_project_path/.dart_tool/flutter_build' (OS Error: Permission denied, errno = 13)</code></p>