B4J Question debug vs release: java.io.FileNotFoundException

johnmie

Active Member
Licensed User
Longtime User
Hi all,
my B4J expandable list app using BBCode now works perfectly in debug mode, but in release mode I get sometimes this error:
java.io.FileNotFoundException: Profile-help.png

Why only in release mode and why always on the same 3 image files and never on any of the other seven images?
Tried to slow down with sleep(100) between panels and to reduce the file size - to no avail.

Does anybody have an idea where I should start looking for the culprit?

Thanks for your help,
john m.
 

johnmie

Active Member
Licensed User
Longtime User
profile-help-1.png 15,543 2021-11-06 11:15 ac E:\!!B4X\!!Quasi\QuasiHelpA03\Shared Files\
profile-help-1.png 15,543 2021-11-06 11:15 ac E:\!!B4X\!!Quasi\QuasiHelpA03\B4J\Files\

I have the impression that B4J searches elsewhere for shared files in release mode, but how to find out where?
 
Upvote 0

johnmie

Active Member
Licensed User
Longtime User
Thank you very much, Erel.
There was indeed a problem with case sensitivity as the file was with a lower case "p" ind the files folder, but when copied to the shared folder it appeared with a capital "P". This, however only solved half the problem.

In my app the user can choose a file anywhere on his HD, which is then copied to the Files folder, but in release mode, the file is physically copied to the Files folder, but still is not recognized by the app, whereas this works perfectly in debug mode.

Any idea why?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
In my app the user can choose a file anywhere on his HD, which is then copied to the Files folder, but in release mode, the file is physically copied to the Files folder, but still is not recognized by the app, whereas this works perfectly in debug mode.

Any idea why?
Yes. It cannot work. Treat the Files folder as a readonly folder (in all platforms). In release mode, these files will be embedded inside the jar.
 
Upvote 0

johnmie

Active Member
Licensed User
Longtime User
Back to the drawing board:
This means I have to adopt another strategy using a) getDataFolder and b) packaging script files with attachments because:
My program has a Pro and a Reader Version. The Pro allows you to create the rather complex scripts* for expandable lists and distribute these as downloads for the Reader version which can stand alone for be part from another app. In neither case do I have control over where the user saves these scripts.

*using BBcode they include formatted text, font-awesome icons, image inserts, links to external resources and tables with wrapped cells, variable row height and jumps to internal reference points. Scripts + all attachments will be exported as zip packages for distribution.
 
Upvote 0
Top