Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18598] LiveView: App does not launch when building from the CLI with LiveView enabled

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.5.1, Release 5.0.2
Fix Version/sn/a
ComponentsAndroid, iOS, LiveView
LabelsengSchedule, qe-3.5.1, regression
ReporterEwan Harris
AssigneeFeon Sua Xin Miao
Created2015-02-20T18:11:00.000+0000
Updated2019-08-27T15:40:57.000+0000

Description

Description

*This does not occur in Studio* When attempting to build using LiveView from the CLI, opening the app fails on both iOS and Android. On iOS the build fails with a runtime error as shown below
[ERROR] Script Error Couldn't find module: localeStrings for architecture: arm64
and on Android it fails with a runtime error shown below
[ERROR] TiExceptionHandler: (main) [9953,9963] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,9963] - In app.js:1,69
[ERROR] TiExceptionHandler: (main) [0,9963] - Message: Uncaught Error: [LiveView] File Server unavailable. Host Unreachable @ 172.16.0.170:8324
[ERROR] TiExceptionHandler: [LiveView] Please ensure your device and computer are on the same network and the port is not blocked.
[ERROR] TiExceptionHandler: (main) [1,9964] - Source: ponseText:!1,c=!0;else if(r-(new Date).getTime()<=0)throw i=!1,c=!0,new Error(
[ERROR] V8Exception: Exception occurred at app.js:1: Uncaught Error: [LiveView] File Server unavailable. Host Unreachable @ 172.16.0.170:8324
[ERROR] V8Exception: [LiveView] Please ensure your device and computer are on the same network and the port is not blocked.
[DEBUG] HTTPClient: The persistent handle is disposed.
If LiveView is run through Studio then there are no errors. *This only occurs in the CLI* This is because the *LiveView server is not started* when building from the CLI. This *is a regression* as in previous versions of LiveView I was able to launch from the CLI with no errors.

Steps To Reproduce

1. Build an existing project in the CLI using the ti build command with --liveview 2. Open the app on device

Actual Result

2. Depending on the platform the app will throw one of the errors shown above

Expected Result

2. The app should not throw an error, or LiveView should not be allowed to be used in the CLI

Comments

  1. Fokke Zandbergen 2015-09-08

    Might be related to Node 0.12. A rebuild often fixes it but its annoying when using the CLI with LiveView.
  2. Fokke Zandbergen 2015-09-22

    It seems to be not just CLI, but also when used from Studio: https://community.appcelerator.com/topic/3392/liveview-error-script-error-couldn-t-find-module-localestrings-for-architecture-x86_64/2
  3. Byron Davies 2015-09-22

    Hi there. That was me. My environment is: Operating System Name = Mac OS X Version = 10.11 Architecture = 64bit # CPUs = 4 Memory = 32.0GB Node.js Node.js Version = 0.10.40 npm Version = 1.4.28 Titanium CLI CLI Version = 5.0.3 node-appc Version = 0.2.31 I've run SDK 5.0.0.GA as well as 5.0.0.v20150920030708, still no joy. The particular app I am testing is iOS only, so I'm not sure if it's an android issue as well at this point. So far I only get this issue on the iOS simulator, seems to run on the device, although when it does the code reload it either crashes or (in my case because I have only landscape orientations in my tiapp.xml file) the app appears upside-down.
  4. Feon Sua Xin Miao 2015-10-05

    I can reproduce this on liveview@1.0.7 but not 1.0.8. Node: v0.12.7
  5. Hans Knöchel 2016-10-18

    [~fmiao] so this is fixed nowadays?
  6. Feon Sua Xin Miao 2016-10-18

    [~hansknoechel], are you able to reproduce the issue? I wasn't.
  7. Tobias Høegh 2017-01-26

    Node: v0.12 is not supported by apcl. any more. So I use Node v4.6.2 - but I'm getting this error: [ERROR] Script Error Couldn't find module: localeStrings for architecture: arm64 I have the newest versions: Mac OS v10.12.2 Ti CLI v5.0.11 Ti SDK v6.0.1.GA Appc v6.1.0 LiveView v1.0.9 I got this error many versions back. So this is not a new thing. Any one have a solution?
  8. Jason Kotchoff 2017-05-18

    Same issue. My Environment: Mac OSX - 10.12.4 - 64 bit Node: 2.14.7 appc cli: 6.2.1 Appcelerator studio: 4.8.1.201612050850 Liveview: ? (not sure how to check - it would be whatever studio comes with) After cleaning out my build directory, trying to run my project with liveview on the iOS simulator failed with the error: {noformat}[ERROR] : CompileC build/Intermediates/StockLight.build/Debug-iphonesimulator/StockLight.build/Objects-normal/x86_64/TiButtonUtil.o Classes/TiButtonUtil.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler {noformat} On the face of it, this sounds similar to the error: [https://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232/47] After subsquently building (successfully) without liveview, I tried liveview again on the iOS simulator and that error went again and I was instead presented with: {noformat} [ERROR] : Script Error { [ERROR] : column = 22; [ERROR] : line = 586; [ERROR] : message = "[LiveView] File Server unavailable. Host Unreachable @ 127.0.0.1:8324\n[LiveView] Please ensure your device and computer are on the same network and the port is not blocked."; [ERROR] : sourceURL = "file:///Users/jason/Library/Developer/CoreSimulator/Devices/3B6D5E3C-00D3-41D0-BB83-730C04C51EE4/data/Containers/Bundle/Application/EEF0EBD0-326D-4FB1-8987-2F5AB5F43562/StockLight.app/app.js"; [ERROR] : } {noformat} As per: [http://stackoverflow.com/questions/35237172/can-we-use-appcelerator-titanium-liveview-in-ios-devices] I then tried running: {noformat} /Applications/Appcelerator\ Studio/plugins/com.appcelerator.titanium.liveview.core_1.1.0.1476939755/node_modules/liveview/bin/liveview server status {noformat} which correctly showed a single running server. I stopped it manually using that liveview command and then re-launched from Appcelerator Studio but again received the File Server unavailable error. Giving up. !https://s7.postimg.org/k27fbrtjf/Screen_Shot_2017-05-18_at_11.20.53_am.png!

JSON Source