Flutter build failed directory permission error

Viewed 29

When i run my apk on debug mode it all works fine and no problem occurs. However I tried to build it for release using

flutter build apk --build-name=1.0 --build-number=1 

And this is what i get

Failed to open output file 'C:\flutter_apps\Restaurant app\build\app\intermediates\flutter\release\flutter_assets\fonts/MaterialIcons-Regular.otf'. The parent directory may not exist, or the user does not have permission to create this file.
FAILURE: Build failed with an exception.

* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156   

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

here is my pubspec.yaml file

flutter:
  uses-material-design: true

  assets:
    - assets/image/
    - assets/language/
    - assets/notification.mp3

  fonts:
    - family: Roboto
      fonts:
        - asset: assets/font/Roboto-Regular.ttf
          weight: 400
        - asset: assets/font/Roboto-Medium.ttf
          weight: 500
        - asset: assets/font/Roboto-Bold.ttf
          weight: 700
        - asset: assets/font/Roboto-Black.ttf
          weight: 900

Expected it to compile the app for release but is getting error

0 Answers
Related