Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14267] LiveView - Running multiple instances of the application on iOS and Android, iOS instances lose connection to LiveView Server

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-07-10T00:56:14.000+0000
Affected Version/sRelease 3.1.1
Fix Version/s2013 Sprint 14, 2013 Sprint 14 Tooling, Release 3.1.2, Release 3.2.0
ComponentsLiveView
Labelsn/a
ReporterBert Grantges
AssigneeChristian Sullivan
Created2013-06-17T18:48:58.000+0000
Updated2013-12-03T20:09:21.000+0000

Description

When trying to run multiple instances of the application with Liveview enabled across multiple devices/platform notice that Android will continue to update, however iOS instances lose the connection and do not continue to update. (have validated this against iOS on Device and iOS on Simulator). See attached video for further clarification. steps to reproduce: 1) enable an existing application (simple screen) for LiveView 2) run android and iOS builds (emulator/simulator) 3) make a change to the code Expected Behavior: Both instances of the application should update continuously Actual Behavior: Android will continue to update, however iOS will stop updating after it updates once. Simulator or Device will need to restart to show updates.

Attachments

FileDateSize
Leor_log_20130628.zip2013-06-28T20:52:19.000+000018436
liveview-test-07032013-v.rtf2013-07-03T12:43:20.000+000062864
Screen Shot 2013-06-27 at Jun 27,1.19.43 PM.png2013-06-27T20:21:46.000+0000188276
Screen Shot 2013-06-28 at 4.29.01 PM.png2013-06-28T20:50:55.000+00001059881
Screen Shot 2013-06-28 at 4.33.52 PM.png2013-06-28T20:51:36.000+00001069656
studiodiagnosticlog-07032013.rtf2013-07-03T12:43:20.000+000033000
studiolog-07032013.txt2013-07-03T12:43:20.000+00004653465

Comments

  1. Bert Grantges 2013-06-25

    Bump - any updates on this?
  2. Christian Sullivan 2013-06-25

    Investigating now.
  3. Christian Sullivan 2013-06-25

    What are versions of liveview and Ti SDK are you using?
  4. Bert Grantges 2013-06-25

    liveview 0.1.24 Studio 3.1.1.201306131423 SDK 3.1.1.GA
  5. Bert Grantges 2013-06-26

    FYI - also just tried this with the latest SDK from nightly builds - 3.1.2.v20130624104600 Still shows the same behavior. Unable to run multiple instances of the application across devices simulator - after there is one app refresh all but the last connecting instance will cease to refresh
  6. Ingo Muschenetz 2013-06-26

    [~bgrantges] I'm more interested in the version of LiveView you are using. Is it still 0.1.24?
  7. Bert Grantges 2013-06-26

    see my previous comment - LiveView 0.1.24 - The latest plugin. Bert
  8. Michael Xia 2013-06-26

    We updated the LiveView plugin on nightly and beta streams to 0.1.25, not the RC. I assume we don't yet want to push to RC until some QE confirmation.
  9. Ingo Muschenetz 2013-06-26

    [~mxia] Can you confirm if 0.1.25 fixes the issue above or if we need an additional fix? Once we have confirmed it works for us, then I can ask [~bgrantges] to test.
  10. Michael Xia 2013-06-26

    It isn't working yet from my testing. I'm running Appcelerator Studio, build: 3.1.1.201306131423 + LiveView Feature 1.0.0.201306251553, and the diagnostic log shows 0.1.25 LiveView is included. Here are my steps: 1. Create a classic two-tab project and run it on iOS simulator with LiveView enabled; 2. Updating the code, and the app reflects correctly right away; 3. Run the app on Android emulator with LiveView enabled; 4. Updating the code, and one time I saw a runtime error, and the other one I saw no update. Here is the log:
        [INFO] :   Finished building the application in 1s 37ms
        [LiveView] Closing file/event server process id: 10056
        [INFO] :   Running application in iOS Simulator
        [LiveView] version 0.1.25
        [LiveView] File Server Started on Port 8324
        [LiveView] Event Server Started on Port 8323
        [INFO] :   Launching application in iOS Simulator
        [INFO] :   Focusing the iOS Simulator
        [LiveView] Client connected
        [INFO] :   Application started
        [INFO] :   testLiveView/1.0 (3.1.1.GA.f7592c1)
        [LiveView] Reload Triggered
        	-REASON: File Changed
         -FILE: /Users/mxia/Documents/Appcelerator_Studio_Workspace/testLiveView/Resources/app.js
        [LiveView] Client disconnected
        [LiveView] Client connected
        [INFO] :   [LiveView] Reloading App
        [INFO] :   [LiveView] Closed Previous Event Server client
        [INFO] :   testLiveView/1.0 (3.1.1.GA.f7592c1)
        [ERROR] :  [LiveView] Disconnected from Event Server
        [INFO] :   [LiveView] Attempting reconnect to Event Server
        [INFO] :   [LiveView] Reconnected to Event Server
        [INFO] :   [LiveView] Reloading App
        [INFO] :   [LiveView] Closed Previous Event Server client
        [INFO] :   testLiveView/1.0 (3.1.1.GA.f7592c1)
        [ERROR] :  Script Error {
        [ERROR] :      backtrace = "#0 () at file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js:575\n#1 () at file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js:610\n#2 () at file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js:496\n#3 () at file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js:463\n#4 () at file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js:395\n#5 () at file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js:641";
        [ERROR] :      line = 556;
        [ERROR] :      message = "[LiveView]";
        [ERROR] :      sourceId = 318560128;
        [ERROR] :      sourceURL = "file://localhost/Users/mxia/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BC4A4025-F280-4196-963C-70043F81EDBA/testLiveView.app/app.js";
        [ERROR] :  }
        [ERROR] :  [LiveView] The operation couldn’t be completed. Operation timed out
        
    It appears LiveView server got disconnected when the Android emulator is launched.
  11. Christian Sullivan 2013-06-27

    This is happening because the liveview.js file is symlinked to the builds. So when android builds it replaces the server url in liveview.js with the android proxy url required to access external network ips (10.0.2.2). Since iOS is still symlinked to the same file it can no longer connect due to the new url being invalid.
  12. Christian Sullivan 2013-06-27

    Fixed in 0.1.26 https://github.com/appcelerator/liveview/commit/5375660cf1231ccfea12b2819687a47dcebc0a31
  13. Michael Xia 2013-06-27

    [~csullivan] I updated to 0.1.26 and ran into a runtime error when launching Android emulator with liveview. Attached the screenshot. Not sure if it's related to this issue itself.
  14. Michael Xia 2013-06-27

    I did a "killall node" from command line and re-launched; still saw the runtime error. Here is the relevant console output:
        ...
        [INFO][ActivityThread(  394)] Pub com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider
        [INFO][ActivityManager(   62)] Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=test.liveview/.TestliveviewActivity } from pid 397
        [INFO][ActivityManager(   62)] Start proc test.liveview for activity test.liveview/.TestliveviewActivity: pid=410 uid=10038 gids={1015, 3003}
        [INFO][dalvikvm(  410)] Could not find method android.app.Application.onTrimMemory, referenced from method org.appcelerator.titanium.TiApplication.onTrimMemory
        [WARN][dalvikvm(  410)] VFY: unable to resolve virtual method 123: Landroid/app/Application;.onTrimMemory (I)V
        [INFO][TiApplication(  410)] (main) [0,0] checkpoint, app created.
        [INFO][TiApplication(  410)] (main) [322,322] Titanium 3.1.1 (2013/06/15 16:10 f7592c1)
        [INFO][TiApplication(  410)] (main) [162,484] Titanium Javascript runtime: v8
        [INFO][TiRootActivity(  410)] (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
        [INFO][dalvikvm(  410)] Could not find method android.app.Activity.invalidateOptionsMenu, referenced from method org.appcelerator.titanium.proxy.ActivityProxy.handleInvalidateOptionsMenu
        [WARN][dalvikvm(  410)] VFY: unable to resolve virtual method 52: Landroid/app/Activity;.invalidateOptionsMenu ()V
        [ERROR][TiApplication(  410)] (KrollRuntimeThread) [1065,1065] APP PROXY: ti.modules.titanium.app.AppModule@405ab898
        [WARN][V8Object(  410)] Runtime disposed, cannot set property 'userAgent'
        [LiveView] Client connected
        [ERROR][TiExceptionHandler(  410)] (main) [3511,4576] ----- Titanium Javascript Runtime Error -----
        [ERROR][TiExceptionHandler(  410)] (main) [3,4579] - In app.js:560,13
        [ERROR][TiExceptionHandler(  410)] (main) [3,4582] - Message: Uncaught Error: [LiveView] File Server unavailable. Host Unreachable
        [ERROR][TiExceptionHandler(  410)] (main) [1,4583] - Source:       throw new Error('[LiveView] File Server unavailable. Host Unreachable');
        [ERROR][V8Exception(  410)] Exception occurred at app.js:560: Uncaught Error: [LiveView] File Server unavailable. Host Unreachable
        [INFO][TiRootActivity(  410)] (main) [0,0] checkpoint, on root activity resume. activity = test.liveview.TestliveviewActivity@4059c450
        ...
        
  15. Christian Sullivan 2013-06-27

    [~mxia] what does
    console.log( Ti.Platform.name, Ti.Platform.name);
    return if you put it in your app.js and build without liveview
  16. Michael Xia 2013-06-27

    Needed to clean the project and re-build. Now iOS simulator and Android emulator are getting updated together. Did observe a behavior where if you exit Android emulator, iOS simulator will no longer get updated. Will open a separate ticket on it.
  17. Michael Xia 2013-06-27

    Opened TIMOB-14425.
  18. Leor Brenman 2013-06-28

    I used an iPhone Sim and an Android AVD. I used the stock Alloy App with a button added to the screen. I edited the screen background (via tss) and the button position (via the xml file) I tested the 0.1.26 Beta of Liveview and it is definitely better than before but I still see several issues: (a) iPhone Simulator still loses connection while Android can be updated (b) I saw one runtime error on Android (c) There is a little trouble getting started where the iPhone wont launch the app and I need to run again; not sure of the 'correct' sequence (what to launch first) Logs and screen shots attached
  19. Leor Brenman 2013-06-28

    Android Runtime Error happened only once (not repeatable)
  20. Leor Brenman 2013-06-28

    iPhone Simulator stops updating after several modifications (with save each time)
  21. Leor Brenman 2013-06-28

    Console, Studio Log and Studio Diagnostic Log
  22. Bert Grantges 2013-07-03

    This is not resolved per my latest update and tests LiveView Version: 0.1.26 Titanium SDK: 3.1.2.v20130624104600 - Open up iOS Simulator and Android Emulator and install to both - Make a change to your XML file and save - iOS Simulator and Emulator update as expected (android update is VERY SLOW see APPTS-2291) - Make a change to the same file or another file and save - Android emulator updates eventually, iOS no longer responds Looking through the console output you can see that the iOS Simulator has disconnected see my attached logs/console output
  23. Bert Grantges 2013-07-03

    Still witnessing this behavior with latest update of liveview. ReOpening
  24. Christian Sullivan 2013-07-10

    resolved in https://github.com/appcelerator/liveview/releases/0.1.27
  25. Michael Xia 2013-08-14

    For Appcelerator Studio, build: 3.1.2.201308091728 (containing LiveView 0.1.32), we only support updating one platform at a time when running with LiveView. Closing this ticket.

JSON Source