1

I am testing a .NET MAUI project for mistakes and it failed to compile some images although they live in a similar root directory

orca_composer_divider_horizontal.9.png: Error APT2261 : file failed to compile.

error Error APT2098 : drawable-hdpi-v4_orca_composer_divider_horizontal.9.png.flat: error: failed to open file. "drawable-hdpi-v4_orca_composer_divider_horizontal.9.png.flat: error: failed to open file.".

For example: the directory net7.0-android\lp\106\jl\res\drawable-hdpi-v4 images non of them work while in the directory net7.0-android\lp\333\jl\res\drawable-hdpi-v4 none of the images report any problem I don't understand why all the project images work except those in that directory.

I tried to see if images were real PNG in that directory by checking them on a hex editor and they have the correct first eight bytes of a PNG. I also tried to open and see their dimensions but they were similar to the images that worked in all other directories. I also checked their names to make sure they don't have any special symbols (non-ASCII characters) and found no problem here is an example in case I missed something

Image that didn't work name: orca_emoji_category_cars.png

one that worked in the other folder: notification_oversize_large_icon_bg.png

8
  • "it failed to compile some images" What does that actually mean? What error did you actually see? Commented Sep 9, 2024 at 15:04
  • sorry you are correct i edited the question and forgot to add that partError APT2098 : drawable-hdpi-v4_orca_composer_divider_horizontal.9.png.flat: error: failed to open file. "drawable-hdpi-v4_orca_composer_divider_horizontal.9.png.flat: error: failed to open file.". Commented Sep 9, 2024 at 15:06
  • The error appears to be saying that it cannot open a file called "drawable-hdpi-v4_orca_composer_divider_horizontal.9.png.flat" (Note the .flat file extension.) Have you confirmed that the file actually exists? Commented Sep 9, 2024 at 15:08
  • it doesn't exist this is the other error. the image error: orca_composer_divider_horizontal.9.png: Error APT2261: file failed to compile. I think they are linked as far as I know the flat file is just a build file and it doesn't exist when compilation fails Commented Sep 9, 2024 at 15:10
  • 2
    thank you. I think this problem was resolved. now i have this issue/error 0>colors.xml(2): Error APT2260 : resource color/white (aka com.DeepSound.Android:color/white) not found but I think it has nothing to do with the images Commented Sep 9, 2024 at 15:24

1 Answer 1

1

The problem was solved by shortening the path leading to the file. The path was longer than the MAUI standard of max 265 characters.

Sign up to request clarification or add additional context in comments.

2 Comments

You should accept your own answer to end the discussion.
FWIW, for other people coming here related to the xml_microsoft_maui_essentials_fileprovider_file_paths.xml.flat file, paths lengths longer than 256 are actually causing lots of trouble in compilation (if only the message could be more explicit) ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.