Android Question [SOLVED] - Difficulty connecting to B4A-Bridge 2.62

rleiman

Well-Known Member
Licensed User
Longtime User
Greetings,

After updating B4A to version 11.20, I can't connect to the B4A-Bridge 2.62 app. Is this the newest B4A-Bridge app available? I also tried to reinstall B4A-Bridge without it connecting.

B4A displays "Trying to connect..." in the status bar and I did make sure the IP address is correct.

Thanks in advance.

Screenshot 2022-01-26 at 19.03.01.png
 

rleiman

Well-Known Member
Licensed User
Longtime User
check your antivirus-if it has a smart firewall the port might be blocked
Hi Alex,

B4A on my computer is installed on my MacBook Pro with the M1 chip running on a Parallels Desktop VM. I think the only anti virus software on there is what's installed by default by Windows 11. I don't think it's using a smart firewall.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
There is no known problem with B4A 11.20, and B4A-Bridge 2.62. I am using this combination with no problems on three different phones. Perhaps something else has changed on your network.
Hi @agraham,

We haven't made any changes to the net in several years. Do you think there is a particular setting I need to set on my phone? I have USB Debugging and Wireless Debugging turn on. Maybe there is a way to use my USB cable to connect directly to B4A?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Do you think there is a particular setting I need to set on my phone?
Not as far as I know. It just works, and has always just worked on all my phones, for me without any configuration.
Maybe there is a way to use my USB cable to connect directly to B4A?
Yes, you can debug over USB with the right driver for the phone on a Windows PC. If you don't know how then check Section 2.4 in Klaus' B4X Getting started booklet.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Greetings,

Here is what I have been noticing. I do get a connection but it's sporadic. When it connects, it can stay connected from 10 minutes up to an hour or so then it will just stop. When it stops, I check to see if the internet is still working and I'm able to browse with Chrome so at least I know it's not the internet or our home router. It looks like I will see if I can find instructions on installing a Samsung USB driver onto my Windows 11 VM to know if I can connect directly with USB.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
I tried to install the driver but nothing happens when I tested it.

I did find on the Google Play Store another B4A bridge app called B4A-Bridge v2.12.4 prime and it connects every time but it gives me a "Error writing file" messages after my app completes compiling. I think I will open a new thread for that app and hope to find out why it's failing to write the apk file.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
I'm able to connect now after rebooting both my phone and my MacBook and restarting Windows 11.
 
Upvote 1

johnaaronrose

Active Member
Licensed User
Longtime User
Is Parallels a Linux OS? I've tried running B4A under Ubuntu 20.04. At first it was Ok with Compile&Run to my Blackvew A80 Pro phone. Then suddenly it came up with:
B4X:
adb.exe F 03-18 13:05:16   262   263 sysdeps_win32.cpp:2908] _wenviron is not set, did you link with -municode?
Has that happened to you?
PS Using B4A-Bridge, B4A connects Ok to the phone with Tools->Connect: first time I ignored the funny message about 'Ping failed' and 'ip Address is most probably incorrect'.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Is Parallels a Linux OS? I've tried running B4A under Ubuntu 20.04. At first it was Ok with Compile&Run to my Blackvew A80 Pro phone. Then suddenly it came up with:
B4X:
adb.exe F 03-18 13:05:16   262   263 sysdeps_win32.cpp:2908] _wenviron is not set, did you link with -municode?
Has that happened to you?
PS Using B4A-Bridge, B4A connects Ok to the phone with Tools->Connect: first time I ignored the funny message about 'Ping failed' and 'ip Address is most probably incorrect'.
Parallels is an app I run under MacOS. I use it only to runs Windows apps like B4X. I haven't tried it with other operating system yet. The good thing about parallels is if the VM crashes, it wont mess up MacOS. All I need to do is restart the VM.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Parallels is an app I run under MacOS. I use it only to runs Windows apps like B4X. I haven't tried it with other operating system yet. The good thing about parallels is if the VM crashes, it wont mess up MacOS. All I need to do is restart the VM.
If I've understood correctly, Parallels is like VirtualBox etc under Ubuntu and other 'Open Source' OSs. Interesting that you haven't had the above adb problem when doing Compile&Run in B4A. This problem occurs with Ubuntu using Wine (which 'traps' Windows calls and sort of carries out the equivalent in calls to Linux). The adb problem could be due to Wine but the developers of it seem to have 'gone away'! When I run B4A in a Windows 10 VM using VirtualBox, B4A tries to connect to my phone but doesn't succeed.

PS I've also tried connecting to the phone by USB cable. Windows 10 VM doesn't see my phone, even though I've enabled USB 'passthrough': in other words, VirtualBox sees the phone but the Windows 10 VM doesn't. Also, Ubuntu 20.04 sees the phone the using Nautilus (the equivalent of File Explorer).
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
If I've understood correctly, Parallels is like VirtualBox etc under Ubuntu and other 'Open Source' OSs. Interesting that you haven't had the above adb problem when doing Compile&Run in B4A. This problem occurs with Ubuntu using Wine (which 'traps' Windows calls and sort of carries out the equivalent in calls to Linux). The adb problem could be due to Wine but the developers of it seem to have 'gone away'! When I run B4A in a Windows 10 VM using VirtualBox, B4A tries to connect to my phone but doesn't succeed.

PS I've also tried connecting to the phone by USB cable. Windows 10 VM doesn't see my phone, even though I've enabled USB 'passthrough': in other words, VirtualBox sees the phone but the Windows 10 VM doesn't. Also, Ubuntu 20.04 sees the phone the using Nautilus (the equivalent of File Explorer).
Parallels Desktop is not open source but it's one that costs some money. I'm able to compile and run the apps I develop with Parallels controlling the VM. I also can't get it to work with a usb cable so I use B4A bridge.
 
Upvote 1

johnaaronrose

Active Member
Licensed User
Longtime User
Running B4A in a VirtualBox Windows 10 VM: when I run I try Tools->Connect (to B4A-Bridge running on my Android phone), I enter the phone's static NAT address I get the usual window asking if that address is OK. I click Yes but all I get from B4A is "Trying to connect". ipconfig Windows command shows:

C:\Users\Administrator>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Ethernet adapter Ethernet:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::8c38:d3f2:7eba:a022%15
IPv4 Address. . . . . . . . . . . : 10.0.2.15
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.2.2

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::b12e:bc4:473e:c659%11
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network #3:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::39ba:3780:df12:2b5f%9
IPv4 Address. . . . . . . . . . . : 192.168.82.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

C:\Users\Administrator>

What do you do in Parallels to make B4A connect Ok?
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Running B4A in a VirtualBox Windows 10 VM: when I run I try Tools->Connect (to B4A-Bridge running on my Android phone), I enter the phone's static NAT address I get the usual window asking if that address is OK. I click Yes but all I get from B4A is "Trying to connect". ipconfig Windows command shows:

C:\Users\Administrator>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Ethernet adapter Ethernet:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::8c38:d3f2:7eba:a022%15
IPv4 Address. . . . . . . . . . . : 10.0.2.15
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.2.2

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::b12e:bc4:473e:c659%11
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network #3:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::39ba:3780:df12:2b5f%9
IPv4 Address. . . . . . . . . . . : 192.168.82.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

C:\Users\Administrator>

What do you do in Parallels to make B4A connect Ok?
I used the default settings when I originally installed Parallels. Rebooting everything and also restarting our router solved the problem for me. I also made sure to force stop the b4A bridge app.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
I got VirtualBox to work with a usb cable once I'd found a usb driver (for Windows 10) for my phone. The phone's manufacturer were not able to find a suitable driver!
I've got B4Bridge to sometimes work on wireless connection to my Windows 10 VM (in VirtualBox using a software network adapter in it of Bridged with B4A set to use my Ubuntu box's wireless static NAT address). The main guy at VirtualBox forum says that VirtualBox's Bridged adapter is not reliable for wireless, so I'll try a wired cable to my router for my Ubuntu box (through a Powerline dongle) with wireless to the phone.
 
Upvote 0
Top