Android Question Files\?home.png: error: failed to open file

luke2012

Well-Known Member
Licensed User
Longtime User
Hi all,
I need to replace a .png file (home.png) with a new version of the image, obviously keeping the same file name, in a B4XPages app. I have to say that I haven't used B4XPages for a while so I don't remember the file management mechanism well.

I tried to delete the old home.png file via the B4A interface then I also deleted the old home.png file from the project's "shared files" folder. Later I inserted the new home.png file into the project's "shared files" folder and now, when I compile, I get this error:

B4X:
B4A Version: 12.20
Parsing code. (0.40s)
Java Version: 8
Building folders structure. (0.70s)
Running custom action. (0.15s)
Compiling code. (0.52s)

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.11s)
Organizing libraries. (0.05s) (AndroidX SDK)
Compiling resources (1.27s)

Linking resources Error ..\Files\?home.png: error: failed to open file.

I would really appreciate some help figuring out how to fix this :)
Thanks.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

josejad

Expert
Licensed User
Longtime User
You can also try press de "synchronize" button in the Files Manager and in the "Designer"
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
does the filename contains any invisible char?

I copied and pasted the file name into notepad++ and activated the function to display all characters (even hidden ones), but only the file name "home" appears.

I created the home.png image file on a mac computer and then copied it directly to the file system of the windows machine where B4X is present.

A strange thing that I noticed is that the first time I copied it into the files folder where the old home.png file was, windows did not ask me if I wanted to replace the file but copied it into the folder without asking me anything and therefore 2 apparently identical home.pngs appeared.

So why this? :-(
\Files\?home.png: error: failed to open file

By the way I have to be able to solve it quickly because Google asks for the update within 3 days otherwise it deletes the developer account (which is also of a client of mine) :-(

Who knows if @Erel can also give us a hand in understanding the mystery?
 
Last edited:
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
does the filename contains any invisible char?

P.S.

I also did this:

1) I deleted the home.png file from the B4A folder

2) I added the home.png file to the Shared Files folder

3) I synced with "'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True" ---> Completed. Exit code: 3

I tried to compile again but I get the exact same error: Linking resources Error ..\Files\?home.png: error: failed to open file.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
I honestly don't know. I'm trying to figure it out too.
When I paste the new home.png file within the Shared Folder, Windows doesn't ask to overwrite and see what happen (attached screen on the left). I check also the two files name using notepad++ looking for hidden chars but their appear identical (see the attached screen on the right). But why ?
 

Attachments

  • Schermata 2024-07-31 alle 18.43.25.png
    Schermata 2024-07-31 alle 18.43.25.png
    8.8 KB · Views: 66
  • Schermata 2024-07-31 alle 18.43.09.png
    Schermata 2024-07-31 alle 18.43.09.png
    7.2 KB · Views: 66
Upvote 0

agraham

Expert
Licensed User
Longtime User
It looks to me that the file created on the Mac must have an invisible character as DonManfred suggested and that is what the question mark is. Maybe that character is not included for some reason when you copy the filename. If possible I would delete all existing home.png files and start afresh. Can you generate it in Windows rather than a Mac?
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
It looks to me that the file created on the Mac must have an invisible character as DonManfred suggested and that is what the question mark is. Maybe that character is not included for some reason when you copy the filename. If possible I would delete all existing home.png files and start afresh. Can you generate it in Windows rather than a Mac?
Thanks for the appreciated reply. The acid test was to delete both files from both Shared Files and B4A Files and insert the old home.png file, recompiling everything works correctly. Unfortunately this image is an old legacy and I have the template (because + a collage of different images that are managed as an object) made in Keynone on Mac.

I should try to recreate the png image with Inkscape directly on the Windows 10 machine on which there is the B4XPages project.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
P.S. Anyway, it would be interesting to understand why, out of technical curiosity, right?
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
It looks to me that the file created on the Mac must have an invisible character as DonManfred suggested and that is what the question mark is. Maybe that character is not included for some reason when you copy the filename. If possible I would delete all existing home.png files and start afresh. Can you generate it in Windows rather than a Mac?

Good news, I solved it generating it in Windows rather than a Mac (using Inkscape to generate the png file).
 
Upvote 0
Top