PDA

View Full Version : PhoneGap error on Android: "Server connection lost" and no data from LiveView



josipradnik
2016-04-11, 05:06
I followed "A guide to building Lianja Mobile business database Apps (https://www.lianja.com/resources/blog/39-coding-tips/446-a-guide-to-building-lianja-mobile-business-database-apps)" to step 6.
Using Android phone and Lianja App Builder on Windows 10 laptop. Trying mobile demo apps only.
Steps:
1.WiFi set on router, on development Win10 machine and phone.
2.On Win10: Lianja App Builder | Projects | lianja_mobiledemo | lianja_mobiledemo (doubleclick) | Phone App View | LiveView
(Message:...is now runnung...connect to 192.168.5.10:3000)
3.On Android: PhoneGap | Server Address: 192.168.5.10:3000 | Connect
(Messages:...Downloading...Extracting...Success!.. .)
App header is showing with label captions and after "Loading..." or refreshing, an error:
"server connection lost
the server failed to respond"

Suspecting on Visual Studio I uninstalled once again (1) MS Visual Studio, (2) Lianja APaaS and (3) node.js additionally. Then installed Lianja again, no Visual Studio yet.

Interesting points, maybe relevant, maybe not:
1) According LiveView, Phonegap LiveView Server is running, but when I issue the commands in Command Window, regardless before LiveView or after LiveView, get always the same error:

cd "C:\Users\xxxx\AppData\Roaming\npm"
phonegap serve
[error] project directory could not be found
2) When I change app in Lianja App Builder, the PhoneGap on phone is automatically refreshing / reconnecting.
3) Trying to open the "example_pagecenter" on phone, only header+menu+arrows are shown, no 2 icons and no "Select a Page" title.
4) The Firewall is off, no VM involved.

What am I missing to get data from server displayed on my phone, as I get labels and headers?

Josip

yvonne.milne
2016-04-11, 07:35
Hi Josip,

Is your Lianja Server definitely running on your development machine?

Regards,

Yvonne

josipradnik
2016-04-11, 08:37
Yes, Lianja Server is definitely running on development machine.
On the bottom of Lianja Server Manager:

"Running - Lianja Server"

On top:

Green arrow icon, "Start/Continue" disabled, other buttons enabled.

Right now
0
active connections

Max connections: 50 (with licence information).
(in which occasion can I see this number "Right now" is ever changed? Is this live LCD?
This is only 1 digit place and I do not remember seeing anything but "0")
Truly, I rarely look it.

I did not change any setting of Lianja Server and Windows Firewall is turned off.

Josip

yvonne.milne
2016-04-11, 09:24
Hi Josip,

Yes, the number updates to show the active connections.

Can you connect to http://192.168.5.10:8001 in your phone's browser and run the Apps?

Regards,

Yvonne

josipradnik
2016-04-11, 10:14
Hi Yvonne,

I can connect from phone's Chrome to this IP address (:8001)
and after log in (admin/admin) get Lianja App Center with 3 tiny :-) known app icons.

Running them I get data and everything is looking fine. I am impressed viewing Lianja for the first time on my phone.
I checked Lianja Server Manager: 6 active connections (expected 1 although: suddenly these 50 does not seam too many anymore).

Immediately, I tried PhoneGap again (:3000) but no avail.
I feel we are almost there.

Josip

barrymavin
2016-06-23, 05:47
For anyone interested in this thread. These issues were resolved on tickets.

Wintz
2017-06-28, 23:07
Hi Barry,
I am facing the same problem. Preview mode works well.
In LiveView mode: the mobile device shows the UI screen, thereafter shows "loading" for 5 mins, then pops "Server Connection lost". Hence, the UI shows a combobox that is not populated and also a non-working commandbox ...

Anybody can point me towards the right direction to troubleshoot? Thkq

Wintz
2017-06-29, 01:51
I found the solution here https://lianjadeveloper.wordpress.com/2017/01/21/phonegap-4/
Turn off the firewall and it works.
Hope it helps others. Good day :)

josipradnik
2017-06-29, 02:12
Hi Wintz,

Instead of turning Firewall off, enable the port for PhoneGap in your Firewall.
On Win10 you need new Outbound Rule (private)

1512

You set port 8001

1513

And Inbound Rule too:

1514

1515

Josip

pauln
2017-06-30, 19:02
Thanks guys for sharing the Information!
So important to document in the forum any "tricks" or "smarts"...
Appreciate it :D