Getting "No file or variants found for asset" found error on my asset

In my case, the problem was that I was missing slash /.

At first, I have added my icons path as below.

  assets:
      - assets/icons

I solve the issue by adding as slash / to the end of the path as below:

  assets:
      - assets/icons/

I was facing the same problem, and I had two mistakes:

  1. I created the "images" folder inside the "lib" folder, and it should be outside the lib folder, it should be in the app root folder. enter image description here

  2. It should be three spaces from the starter line as @Darshan said

    -assets/credentials.json // <-- count three spaces from start

    It should appear a grey line, like this

    enter image description here


Check identation of assets. Generally it should have 3 spaces from start of new line.

assets:
 - assets/credentials.json // <-- count three spaces from start