Bug? UsbSerial Library Referenced Missing

Mark_Hugill

Member
Licensed User
Longtime User
Hello
I'm have an issue with version 5.20 B4A when using the UsbSerial library 2.3 & 2.4.
When compiling I get the following error;

*** Remote compilation mode ***
B4A version: 5.20
Parsing code. (0.00s)
Compiling code. (0.04s)
Compiling layouts code. (0.00s)
Compiling debugger engine code. (0.93s)
Sending data to remote compiler. Error
step: Convert byte code - dex.
A referenced library is missing: usbserial

However if I use version 4.x B4A it's not a problem and works?

Any ideas?

Thanks,
Mark
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Do you have both v4.x & v5.20 installed on the same machine? If so, have you checked that the UsbSerial library is in the Libraries folder for both installations?

- Colin.
 

Mark_Hugill

Member
Licensed User
Longtime User
Hi Colin

I have 5.20 installed in

C:\Program Files (x86)\B4A\Basic4android\

and the usbserial.jar in the "\Libraries\" directory




I have 4.3 installed in

C:\Program Files (x86)\Anywhere Software\Basic4android\

and the usbserial.jar in the "\Libraries\" directory


The lib tab on both apps found the UsbSerial(2.40) file so the app has located them. It's only when you build that there is the error in 5.20 only.
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Hi Colin

I have 5.20 installed in

C:\Program Files (x86)\B4A\Basic4android\

and the usbserial.jar in the "\Libraries\" directory




I have 4.3 installed in

C:\Program Files (x86)\Anywhere Software\Basic4android\

and the usbserial.jar in the "\Libraries\" directory


The lib tab on both apps found the UsbSerial(2.40) file so the app has located them. It's only when you build that there is the error in 5.20 only.
Hmmm - I've never had 2 versions of B4A installed on the same machine, so I don't know. Could it be that the v5.20 installation can't reconcile the "B4A" path (ie: is it expecting to be installed in "Anywhere Software")?

Do you have this issue with any other libraries in v5.20? Have you tried creating a new project & adding that library? Failing that, it might have to be an Erel answer that gets you out of this!

- Colin.
 

Mark_Hugill

Member
Licensed User
Longtime User
I've done the whole uninstall and had them installed to there default locations one at a time and it's the 5.20 that still fails.
I've built the default blank project and it installs to the phone fine, but as soon as I tick the usbserial library and build it, I get the error. Even when nothing is referring to it in code.
 

James Chamblin

Active Member
Licensed User
Longtime User
Maybe try deleting Usbserial.jar and Usbserial.xml, then copy them from the 4.3 directory. The files might be corrupt.
 

Mark_Hugill

Member
Licensed User
Longtime User
No Joy. I took the 4.3 UsbSerial files and place them into the 5.20 Library folder and the same problem exist still.
So I take it that no else is experiencing this issue when referencing the UsbSerial 2.4 library with version 5.20 B4A?

I can still do all my work using 4.3 but I like the 5.2 interface :)
 

Mark_Hugill

Member
Licensed User
Longtime User
Here is another error I get

*** Remote compilation mode ***
B4A version: 5.20
Parsing code. (0.01s)
Compiling code. (0.05s)
Compiling layouts code. (0.02s)
Compiling debugger engine code. (1.51s)
Sending data to remote compiler. Error
step: Compiling generated Java code.
javac 1.7.0
src\bltech\boss\com\main.java:346: error: cannot find symbol
public static anywheresoftware.b4a.objects.UsbSerial _usb = null;
^
symbol: class UsbSerial
location: package anywheresoftware.b4a.objects
1 error




Not sure why it's referring to Java 1.7.0 as I only have jdk1.8.0_60 installed
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
So I take it that no else is experiencing this issue when referencing the UsbSerial 2.4 library with version 5.20 B4A?
Works fine here.

Not sure why it's referring to Java 1.7.0 as I only have jdk1.8.0_60 installed
Can you post a screenshot of Tools - Configure Paths dialog?
 

Mark_Hugill

Member
Licensed User
Longtime User
upload_2015-10-1_10-10-53.png
 

James Chamblin

Active Member
Licensed User
Longtime User
Try this. Go to the library folder, delete both the usbserial.jar and usbserial.xml from that location. Then download again from the library forum and install the .jar and .xml file again.
I would also suggest making a new folder for downloaded libraries, then pointing Additional Libraries to it.
 

Mark_Hugill

Member
Licensed User
Longtime User
Turns out that any library in the "Additional Library" path cannot be compiled.
So it looks like any additional library added other than the initial install ends up as missing when compiling but are located in the library window?


upload_2015-10-2_10-16-6.png



Additional libraries added to manager and can be referenced.

upload_2015-10-2_10-17-8.png


But not complied?
upload_2015-10-2_10-18-19.png
 

James Chamblin

Active Member
Licensed User
Longtime User
Decided to check the USBSerial library myself. The Readme.txt file says "Move both jars and the xml file to your Additional Libraries folder." But I only see one .jar in the .zip archive. Is it possible a .jar file is missing, or should the Readme.txt file be saying "Move both the jar and the xml file to your Additional Libraries folder."

Edit: I think the latter as I was able to compile fine with just the one .jar and .xml
 
Last edited:
Top