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-androidlp106jlresdrawable-hdpi-v4 images non of them work while in the directory net7.0-androidlp333jlresdrawable-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
The problem was solved by shortening the path leading to the file. The path was longer than the MAUI standard of max 265 characters.
1