Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23678] Windows: Device is unable to connect to LiveView server

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-09-08T01:27:03.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 6.1.0
ComponentsLiveView, Windows
Labelsqe-5.4.0
ReporterEwan Harris
AssigneeGary Mathews
Created2016-07-25T16:59:17.000+0000
Updated2017-05-17T13:45:19.000+0000

Description

Description

When attempting to build to device, the app will throw the below error when the app loads.
[ERROR] :  Application Error: {
[ERROR] :    "line": 2,
[ERROR] :    "column": 10,
[ERROR] :    "message": "Error while require(/app) [LiveView] File Server unavailable. Host Unreachable @ 192.168.2.2:8324\n[LiveView] Please ensure your device and computer are on the same network and the port is not blocked.",
[ERROR] :    "native_stack": [
[ERROR] :      "JSExportClass<class Titanium::GlobalObject>::CallNamedFunction"
[ERROR] :    ]
[ERROR] :  }
However * The device and pc are on the same network * I am able to access the LiveView server by going to http://192.168.2.2:8324 in edge on the device * I am able to access the apps app.js by going to http://192.168.2.2:8324/app.js in edge on the device

Steps to reproduce

Ensure you disable the vEthernet switch as noted in TIMOB-23664

Enable LiveView in Studio

Build a project to Windows Phone Device

Try accessing the ip listed in the LiveView error from edge, and also accessing /app.js

Actual result

The device will not be able to connect to the LiveView server, but the LiveView server can be accessed using edge

Expected result

The device should be able to connect to the LiveView server

Attachments

FileDateSize
app.js2016-07-25T20:20:33.000+0000891
app2.js2016-07-25T20:21:53.000+0000590
server.js2016-07-25T20:19:50.000+0000288

Comments

  1. Ewan Harris 2016-07-25

    I believe I may know the root cause for this. In this loop LiveView will determine whether the connection is successful using this code here https://github.com/appcelerator/liveview/blob/master/build/liveview.js#L560-L567 Taking this code out and extracting it into the attached app.js shows that the readystate of the HTTPClient is never set to 4 by the SDK, as it is done on iOS and Android.

    Steps to reproduce

    Copy the code in the attached app.js and paste into your project, change the ip to your own, keep the port the same

    Download the attached server.js and start it with node server.js

    Build for device or emulator and then click the button

    Also see app2.js which uses the onload function rather than the way LiveView handles it, on Windows when onload is called request.readystate = 2, however on Android request.readystate=4
  2. Gary Mathews 2016-07-27

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/791
  3. Kota Iguchi 2016-07-29

    PR pull/791 looks good, but it does not make LiveView work on Windows.
  4. Gary Mathews 2016-08-26

  5. Kota Iguchi 2016-08-28

    Merged TIMOB-23664.
  6. Ewan Harris 2017-05-17

    Verified using: Windows 10 Pro Ti SDK: 6.1.0.v20170516173434 Appc CLI: 6.2.2-master.13 Appc NPM: 4.2.9 Windows 10 Mobile emulator Lumia 550 (10.0) LiveView 1.1.4 Studio: 4.9.0.201705170851 Devices and emulators are now able to connect to the LiveView server and changes are seen when the app is reloaded Closing ticket

JSON Source