Android Question Warnings for unused files

LucaMs

Expert
Licensed User
Longtime User
Although I am almost certain of not getting a... useful answer...

Complicated explanation, especially in English, sorry.

I create a B4A library. This library contains a routine that requires a file name; the library will read and use the file from "DirAssets".
The project that will use the library will have the file in "DirAssets" but it will not use it directly, then you will get a warning for unused files.


I don't think there is a solution, right?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
(Make sure to read the file correctly: https://www.b4x.com/android/forum/threads/java-loading-files-from-a-library.38728/#content)

The IDE doesn't know that your library loads files. If you are using B4A v6+ then you can create an AAR package and include the files there. This will also make it simpler for developers which won't need to copy the files the project.

You can add this code to the main module to ignore this warning:
B4X:
#IgnoreWarnings: 15
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
First of all, thank you for your reply, Erel.

I have understood... almost nothing

I read it, but I don't understand if I need it.
Example (real - b4a 6): the developer must inizialize my library passing an image file name; an ImageView will then be filled using a couple of routine, mainly from the LoadBitmapSample command. It seems to work, but I have to read better that thread to understand if this way can be wrong.


The IDE doesn't know that your library loads files. If you are using B4A v6+ then you can create an AAR package and include the files there. This will also make it simpler for developers which won't need to copy the files the project.
I don't know what AAR packages are (I suppose that they must be created using "other tools", I'm talking about simple libraries created with b4a, Alt+5).


You can add this code to the main module to ignore this warning:
B4X:
#IgnoreWarnings: 15
Yes, I know, but then the warnings will not be shown also for "real unused files".


Thank you
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…