[TIMOB-17949] CLI: Build fails when using Node 0.11.14
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2015-03-23T15:35:12.000+0000 |
Affected Version/s | Release 3.4.0, Release 4.0.0 |
Fix Version/s | Release 4.0.0 |
Components | CLI |
Labels | n/a |
Reporter | Tim Poulsen |
Assignee | Tim Poulsen |
Created | 2014-11-03T20:39:52.000+0000 |
Updated | 2015-03-24T20:59:39.000+0000 |
Description
The next version of Node is reportedly imminent. When running the newest unstable / prerelease build (0.11.14)
ti build -p ios
fails with
[DEBUG] Symlinking /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/Resources/iphone/ti-mocha.js => /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/iphone/build/Debug-iphonesimulator/TestSuite.app/ti-mocha.js
[INFO] Processing Titanium namespace resources
[DEBUG] Copying /Users/admin/Library/Application Support/Titanium/mobilesdk/osx/3.5.0/iphone/modules/ui/images => /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/iphone/build/Debug-iphonesimulator/TestSuite.app/modules/ui/images
[INFO] Skipping xcodebuild
[INFO] Finished building the application in 4s 579ms
/Users/admin/repos/titanium_skypanther/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
Socket.socketErrorListener (_http_client.js:268:42),Socket.emit (events.js:107:17),net.js:436:14,process._tickCallback (node.js:372:11)
ti build -p android
fails with a similar
[INFO] Creating unsigned apk
[INFO] Processing /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/src
[INFO] Writing unsigned apk: /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/bin/app-unsigned.apk
[INFO] Using MD5withRSA signature algorithm
[INFO] Signing apk: /Library/Java/JavaVirtualMachines/1.6.0_65-b14-462.jdk/Contents/Home/bin/jarsigner "-sigalg" "MD5withRSA" "-digestalg" "SHA1" "-keystore" "/Users/admin/Library/Application Support/Titanium/mobilesdk/osx/3.5.0/android/dev_keystore" "-storepass" "*******" "-signedjar" "/Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/bin/TestSuite.apk" "/Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/bin/app-unsigned.apk" "tidev"
[INFO] Aligning zip file: /android-sdk/build-tools/20.0.0/zipalign "-v" "4" "/Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/bin/TestSuite.apk" "/Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/bin/TestSuite.apkz"
[INFO] Writing build manifest: /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/android/build-manifest.json
/Users/admin/repos/titanium_skypanther/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
Socket.socketErrorListener (_http_client.js:268:42),Socket.emit (events.js:107:17),net.js:436:14,process._tickCallback (node.js:372:11)
And mobileweb builds fail with
[DEBUG] Analyzing /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/mobileweb/titanium/Ti.js
[DEBUG] Analyzing /Users/admin/Documents/Titanium_Studio_Workspace/TestSuite/build/mobileweb/titanium.js
[INFO] Creating the filesystem registry
[INFO] Creating the index.html
/Users/admin/repos/titanium_skypanther/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
Socket.socketErrorListener (_http_client.js:268:42),Socket.emit (events.js:107:17),net.js:436:14,process._tickCallback (node.js:372:11)
-Possibly an issue with ios-lib, specifically node-ios-device-
The failure is being caused by the LiveView plug-in. By removing the following from the hooks array in my .titanium/config.json file I am able to build just fine.
"/Applications/Appcelerator Studio/plugins/com.appcelerator.titanium.liveview.core_1.1.0.1411521639/node_modules/liveview/hook"
I further investigate this issue and this is happening as liveview attempts to kill the existing file servers during the post build event processing. It tries to invoke a URL and then node process terminates with the reported error. So, if a (file) server is not running on a port (6789) that we try to run a URL (http://localhost:6789), then the node process crashes immediately - the error is not caught in try/catch block as well. So, in order to fix this issue, we need to figure out a way to kill all existing file servers of liveview. In the meanwhile, we need to understand why running a arbitrary url will terminate/crash the node process.
Duplicate of linked issues.
Closing as duplicate.