Android Question Text Relocations Enforced - need help recompiling libserial_port.so

biometrics

Active Member
Licensed User
Longtime User
After many years of being able to mostly ignore the manifest SDK versions I am forced to target SDK 29 due to a new device we need to support.

I have been using this library to interface with a physical UART: https://www.b4x.com/android/forum/threads/open-read-write-uart-serial-device.21440/post-165146

Now I am getting this compilation error: /lib/arm/libserial_port.so" has text relocations (https://android.googlesource.com/pl...md#Text-Relocations-Enforced-for-API-level-23)

I note the explanation given here and that @KZero was able to find a new version of the .so and replace it in the .jar: https://www.b4x.com/android/forum/threads/library-has-text-relocations-on-api26.96747/#post-610350

It seems this is the original source: https://github.com/Rairmmd/Android-Serial-Port

My Java skills are minimal, can anyone help out to recompile this .so to be compatible, please?
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
My Java skills are minimal
We share our limited Java knowledge and on top of that my knowledge of the Chinese language in the referenced library is really zero ?. But where would we be without Google (translate) ?.

You refer to SerialLibJab.jar which sets the serial port to allow serial communication between two serial ports.

The serial port on your unnamed device has a UART, to which one or more commands must be sent so that communication is possible with your unknown unnamed device. Those commands are different for each UART. Anyway you have to use a library for this to solve that challenge. Two possibilities either you have the source of the library, or at least you have the jar of that library.

A library that probably looks like it won't help us, but we need the 2nd jar and/or AAR file or its current source which is now throwing the error. I want to try to run it through a compiler with Android API 33 to see what errors and invalid routines to pick out and fix. Can post the missing jar/aar/source to the forum?
 
Upvote 0

biometrics

Active Member
Licensed User
Longtime User
Current version: https://www.b4x.com/android/forum/threads/open-read-write-uart-serial-device.21440/#post-165146

Source: https://github.com/Rairmmd/Android-Serial-Port
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
@Erel seems like a ChatGPT bot...
ChatGPT bot... or not without the requested information your challenge will not be solved without it.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
The challenge is that what you are using (source or jar/ear) is causing the error to be fixed. What works with the old API version is what we should look at, not something similar because every UART works and needs to be controlled slightly differently (see the various post about it). In addition, you point to a 6-year-old library, so it may not work with the current API level. I don't know what compiler you're using, but that jar will be in a libs directory if you're using SLC, or with #AdditionalJar command or with the libraries manager because Android doesn't have a serial interface by default.
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…