Muhammad Ali
Muhammad Ali

Reputation: 93

Unable to find directory entry in pubspec.yaml" when building Flutter app for Windows

I'm trying to build my Flutter app for Windows, but I keep running into the following error:

CUSTOMBUILD : error : unable to find directory entry in pubspec.yaml: D:\\solidcheck\\online\\assets\\images\\ [D:\\solidcheck\\online\\build\\windows\\x64\\flutter\\flutter_assemble.vcxproj]

C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'D:\\solidcheck\\online\\build\\windows\\x64\\CMakeFiles\\2b5807d9d0daadf5bd2fe86d3a97c0f1\\flutter_windows.dll.rule;D:\\solidcheck\\online\\build\\windows\\x64\\CMakeFiles\\3da8e4db21fc5d1c48fd0b85b7c50cbd\\flutter_assemble.rule' exited with code -1. [D:\\solidcheck\\online\\build\\windows\\x64\\flutter\\flutter_assemble.vcxproj]

Error: Build process failed.

It seems to be related to a missing directory entry in pubspec.yaml for assets. I have verified that the path D:\\solidcheck\\online\\assets\\images\\ exists and contains the expected files.

What I've Checked:

  1. Verified Asset Path: I confirmed that the path D:\\solidcheck\\online\\assets\\images\\ exists and is correctly listed under the assets section in pubspec.yaml.

  2. Clean Build: I ran flutter clean and then tried to rebuild the project.

  3. Dependencies: I checked that all dependencies and Flutter plugins are up-to-date and correctly configured.

  4. Reinstalled Tools: I reinstalled the necessary build tools and verified that Visual Studio and CMake are properly set up.

pubspec.yaml File:

name: demo
description: "A new Flutter project."
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: '>=3.4.3 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.6
  flutter_riverpod: ^2.5.1
  flutter_windowmanager: ^0.2.0
  responsive_framework: ^1.4.0
  http: ^1.2.1
  shared_preferences: ^2.2.3
  flutter_launcher_icons: ^0.13.1

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter_icons:
  android: true
  ios: true
  image_path: "assets/logos/solidcheck-icon-online.png"
  windows:
    generate: true
    image_path: "assets/logos/solidcheck-icon-online.png"

flutter:
  uses-material-design: true
  assets:
    - assets/logos/
    - assets/images/
  fonts:
    - family: Schyler
      fonts:
        - asset: fonts/Schyler-Regular.ttf
        - asset: fonts/Schyler-Italic.ttf
          style: italic
    - family: Trajan Pro
      fonts:
        - asset: fonts/TrajanPro.ttf
        - asset: fonts/TrajanPro_Bold.ttf
          weight: 700

What I Expected:

I expected the build process to complete successfully without errors, specifically resolving the issue where the build system is unable to find the directory entry specified in pubspec.yaml.

Any Suggestions?

How can I resolve this issue? Any help or suggestions would be greatly appreciated!

Upvotes: 2

Views: 132

Answers (0)

Related Questions