B4J Question Custom View Class to Library: Image not found

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

whilst starting to build a library of custom views (CV), ran into an issue when the CV has an image included.
When using the CV in an example project and running, an error occurs:
B4X:
Caused by: java.lang.RuntimeException: Asset file not found: select.png
The file select.png is part of the CV and located in the CV dirassets folder.

Question: Is it required to copy CV images to the example project files folder as well or is there a way to included these in the library jar (which I thought is handled by having those in the files folder)?

CV (RLControls > SelectFileTextField) & Project example (Example1) attached.
 

Attachments

  • jRLControls.zip
    5.5 KB · Views: 256
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Create a zip file with the files you want to be included. Name it RLControlsFiles.jar.
The zip file should include a folder names Files (case sensitive) and all the files should be in that folder.
Put the zip file in the additional libraries folder.
2. Add a reference to this jar: #AdditioanlJar: RLControlsFiles
3. Build the library. The xml file will include a reference to RLControlsFiles.jar.
4. Distribute the files jar together with the library jar and xml files.
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Got it & Tested - Nice trick. Thanks for your Help.

For those of interest, attached jRLViews [a better name to be conform with Custom View :) ] source with its first custom view & example ... many more in progress...
 

Attachments

  • jRLViews.zip
    18.8 KB · Views: 278
Upvote 0
Top