B4J Tutorial [B4X] Using/running B4A and/or B4J on 64 bit Linux Mint 20.2 Cinnamon with 64 bit Wine

johnaaronrose

Active Member
Licensed User
Longtime User
Just an update on my use of B4A under Linux. I've given up trying to Compile&Run (using B4A-Bridge) due to the fail with a strange adb message. partly this is due to Wine seemingly no longer being supported: the devs do not reply to recorded bugs or email messages. So I now use VirtualBox on my Ubuntu 20.04 host with a Windows 10 guest. This works Ok except that I have not been able to make the AVD Manager work (as posted in https://www.b4x.com/android/forum/threads/start-of-an-avd-gives-apache-error.139285/). That would have given me the facility to test an app on a number of phones & tablets such as the popular Samsung etc ones, as I only have a budget phone & tablet.
 

Laurent95

Active Member
Licensed User
Longtime User
Hello,

I know it's considered like "an old thread" , but it's related to something i have never found on an other place till now
It's ok to do the same on a linuxmint 19.3 environment, it's based on Ubuntu 18.04, result of uname -a :
Linux loulou-N71Vg-Asus 5.4.0-113-generic #127~18.04.1-Ubuntu SMP Wed May 18 15:40:23 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I ask if i can avoid to use a virtualbox, but i fear i need to use one. Especially because B4R will don't work, i think, under Linux with Wine without problems.

Thank you,
have a nice day,
Laurent
 
Last edited:

walt61

Active Member
Licensed User
Longtime User
Hi Laurent,

I originally (as described in this thread, I mean) installed B4A and B4J on Linux Mint 20.2 and have in the meanwhile upgraded to 20.3 and everything still works. I haven't used B4R yet; I'm sure the IDE will work as well, but have no idea about the communication with the Arduino et al.

I would say: give it a shot. If it turns out it doesn't work, you only lost an hour and temporarily used some disc space. I tested virtualbox too on my laptop before starting this here method, but it was way too slow so I didn't want to go that way either.

Good luck!
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Thanks for the comprehensive tutorial.
Followed the instructions on Ubuntu 20.04.

All went well until running the first B4J UI application.

The classical Hello World UI app crashed with error message:
Java:
java.lang.IllegalArgumentException: STRIDE * HEIGHT exceeds length of data

Also the B4J designed preview showed a blank screen.

After trying various, found the solution in changing the screen resolution from default 96 to 100 or higher.
Steps taken:
  • start winetricks
  • select default wine prefix
  • select run winecfg
  • select tab graphics
Change the screen resolution to 100 or higher.
Applied, closed the window and winetricks.

Started B4J and both the designer preview as well as running the UI form are displayed properly.

Tested with B4J UI and B4J B4XPages app.
 

walt61

Active Member
Licensed User
Longtime User
Fantastic, thanks Rob! That's one I had on my to do list for when I was feeling patient and brave enough to start looking for it

On my Mint, the WYSIWYG Designer now indeed shows the form instead of a black window. Compiling in debug mode still produces the error here so I'm keeping it on my list for now. Post #1 will be updated in a minute.
 

Laurent95

Active Member
Licensed User
Longtime User
Hello,

Thanks, i think that i'll need to have luck.
Actually, even Lubuntu 20.3 crashed on my very old Asus laptop. And i stay away from heavy environments, like Cinnamon.
But, i'm trying Chromium also, it'll seem that the responsible of many crashes was Firefox.

Yes Virtualbox is not really fluent for that things. Especially maybe because my Intel CPU is too old and haven't the material virtualization, so that turn in 32 bits.

Anyway, i'll try your tutorial asap, but unfortunately there are many things yet who don't work with a snap when you try to use some specific softwares under Linux

I'll say if that work or not.

Have a nice day,
Laurent
 

apogon

New Member
Hi, I have installed B4X using bottles, in my opinion it is much easier, however I am very new and I don't know if all the functionality is correct, but I have managed to open and run simple things. I always refused to use B4J because it is not available for linux (it is my base development system) but with boottles it is like working with containers and it is much simpler to install.
 

apogon

New Member
Of course. Actually installing it on bottles is quite easy, but for now I'm learning a bit about B4X and then I can do the tutorial, if it's going soon.
 

b4auser1

Well-Known Member
Licensed User
Longtime User
Signing package file (private key). Error
I have setup and configured B4A following the manual [B4X] Using/running B4A and/or B4J on 64 bit Linux Mint 20.2 Cinnamon with 64 bit Wine
I created a B4Xpages project from the template and tried to run in it on a device using B4A-Bridge.

Unfortunately, the IDE raised an error, see below.
What is the reason and how to resolve it ?

B4A Version: 12.80
Parsing code. (0.04s)
Java Version: 14
Building folders structure. (0.03s)
Compiling code. (0.07s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.51s)
Linking resources (1.00s)
Compiling debugger engine code. (0.01s)
Compiling generated Java code. (0.01s)
Finding libraries that need to be dexed. (0.01s)
Dex code (2.00s)
Dex merge (3.45s)
Copying libraries resources (0.06s)
ZipAlign file. (0.07s)
Signing package file (private key). Error
Exception in thread "main" java.io.IOException: Call not implemented
at java.base/java.io.RandomAccessFile.setLength(Native Method)
at com.android.apksig.ApkSigner.sign(ApkSigner.java:216)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:395)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:92)
 

walt61

Active Member
Licensed User
Longtime User
I haven't experienced that one; perhaps one of these helps (if not, someone smarter than me will have to pipe up):
- found on the forum regarding other private key errors: reload your private sign key (from the Tools menu)
- not sure if the IDE just reads the private sign key file once, but in case it doesn't:
* does the filename contain special characters (including spaces)? If so, I'd try (possibly pointlessly) with a name without those.
* could there be a permission/ownership problem with the file?
 

b4auser1

Well-Known Member
Licensed User
Longtime User
I have checked all the points.
Everything is ok.
Anyway thank you for the hints.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…