B4J Question Problems building b4xlib, what am I doing wrong... [SOLVED]

max123

Well-Known Member
Licensed User
Longtime User
Hi all

I tried to pack one my library to b4xlib but I had some strange issues, after
I add my class module and manifest.txt in the file and renaming it from .zip to .b4xlib, I put
it in B4J Additional Libraries folder.

Refreshing the IDE library tab I can see it, but a message will appear that says that a word is not in a dictionary,
probably the error is parsing the manifest file.

After this the ide just see version 0.00, but I set it in the manifest.txt this way:
Version=1.00
After this my class is not recognized at all in my project.

Note that with class inline in the project all is working.
Here I suppose I do some confusion because the class name is AsyncCanvas and the b4xlib library name is jAsyncCanvas to target B4J platform.

Because all this not works, I've decided to create a small project with just a small class that do nothing, just sum two numbers, this to test it. In this case after selectig it in the tab, the IDE recognize my class and I can dimension and use it, even return a sum number :D, but I always have the same message that may manifest cannot parse a word.

Here is the content of the manifest:
Version=1.00
Supported Platforms=B4J
B4J.DependsOn=JavaObject, jXUI
note that JavaObject and jXUI are not really required here, I just put it to have the same on the main project.
I omitted other platform dependences because it only should work on B4J, but even if I specified it should
work only on B4J, the IDE see it multiplatform, see attached screenshot.

What I doing wrong ?
I've a chance to get it working ? o_O

Attached the small project and created b4xlib.

Finally, I have to release an open source library in the forum, I want to pack inside b4xlib or I will release the inline code as is, but because b4xlib exists I think it is a best option.

Thanks for any tip to get it working.
 

Attachments

  • MyClass.b4xlib
    640 bytes · Views: 68
  • Screen Shot 06-19-23 at 06.16 PM.PNG
    Screen Shot 06-19-23 at 06.16 PM.PNG
    62.6 KB · Views: 67
  • Test_b4xlib.zip
    1.9 KB · Views: 57
Last edited:

max123

Well-Known Member
Licensed User
Longtime User
Yes, thanks @aeric this is another question....

The problem here for sure is that I doing something wrong, but how ?
The attached small b4xlib does not work correctly here.... works for you ?

I just zipped the class module with a manifest.txt with 3 lines, not so complex.... and renamed to .b4xlib
 
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Which one? MyClass or Test ?
Test is the simple project test, MyClass is a simple class. Try to put b4xlib to B4J additional folder, then open Test.
 
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
I don't remember, probably I removed a simple class from the project, just to test the library, because not double inclusions....
If this is true, here is the simple MyClass, forget complexity :D but it is inside b4xlib:
B4X:
Sub Class_Globals
    Private fx As JFX
    Private one, two As Int
End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(o As Int, t As Int)
    one = o
    two = t
End Sub

Sub GetSum As Int
    Return one + two
End Sub
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Ok thanks @aeric, may it is the screen that is too smalll :D may I need miscroscope to see dots....
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
So I've spent a day for a dot ? How will cost a dot in your country ? :D :D
But may it is not the same in my main project, now I will check dots..... that they are very small...
If the main project manifest file have 2 dots, you saved my life....
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Ok, now the test project works, removed 1 dot, many thanks for tip.

The problem now that is the manifest.txt file of main project have just one dot but it wont work.
I've tried to replace the manifest with the same of MyClass bu not works, always see version 0.00 and class not recognized.

Can I post to you in private the b4xlib to check ? May you have a microscope and see some other dots... ??? šŸ¤£šŸ˜‚šŸ˜…
In private now but then I release public.... is b4xlib, have open code.
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
Ok, now the test project works, removed 1 dot, many thanks for tip.

The problem now that the manifest.txt file of main project have just one dot but it wont work.
I've tried to replace the manifest with the same of MyClass bu not works, always see version 0.00 and class not recognized.
It works for me. Try right click and refresh the Libraries Manager.
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
It works for me. Try right click and refresh the Libraries Manager.
Yes, the Test project is working now even for me..... just removed a dot. ;)
But the main project does not.... and the manifest just have one dot. Used same manifest.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Yes, the Test project is working now even for me..... just removed a dot. ;)
But the main project does not.... and the manifest just have one dot. Used same manifest.
Then maybe an invisible space or something else.
Can you screenshot your WinRAR content if you are using one?

Or upload your manifest file.
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Screen Shot 06-19-23 at 08.08 PM.PNG

Originally the library should called jAsyncCanvas because is B4J only library, but to avoid problems for now I just renamed it AsyncCanvas, both, the class module and the AsyncCanvas.b4xlib.

I don't see strange dots here.... you ?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
View attachment 143046
Originally the library should called jAsyncCanvas because is B4J only library, but to avoid problems for now I just renamed it AsyncCanvas, both, the class module and the AsyncCanvas.b4xlib
Looks good.
Try edit the version to other value such as 1.01 and see is this the correct file you are loading.
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Ok, I will try that, thanks.

Note that orioginally I started to add it as jAsyncCanvas, may the ide saved something and now always unrecognize it ?
However I started the IDE several times, even do a refresh.

I see an ide message that something is wrong while parse libraries. I changed the version to 1.01 in the manifest.
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Screen Shot 06-19-23 at 08.25 PM.PNG

Always version 0.00 and class not recognized.... it inline works.
 
Upvote 0
Top