[TIMOB-24539] Hyperloop: Android - Unhandled CLI error thrown sometimes
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-06-22T12:17:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Hyperloop 2.1.2 |
Components | Android, Hyperloop |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Jan Vennemann |
Created | 2017-03-28T09:55:06.000+0000 |
Updated | 2017-06-23T00:06:37.000+0000 |
Description
When building Hyperloop for Android, sometimes one of the following errors is thrown:
[INFO] Starting Hyperloop assembly
[INFO] [Hyperloop] Using system metabase cache file at /var/folders/tt/7hv0vw1d4nx64kbpcdd4dsn00000gn/T/hyperloop_android-23_metabase.4b1ef509144aeedbb0887170e4fa336933582ed3.json.gz
[INFO] Skipping Hyperloop compile, no usage found ...
[INFO] Finished Hyperloop assembly
[ERROR] read ECONNRESET
or (twice now)
[INFO] Starting Hyperloop assembly
2017-03-28T08:40:02.077Z | ERROR | An uncaught exception was thrown!
Cannot read property 'shift' of undefined
2017-03-28T08:40:02.078Z | ERROR | Cannot read property 'shift' of undefined
This happens randomly and can be resolved by doing a clean build. Even when not changing anything Hyperloop-related, this happens from time to time.
*EDIT*: Additional logs (only occurred once in trace-mode):
[INFO] Starting Hyperloop assembly
/Users/jonahpolack/Library/Application Support/Titanium/plugins/hyperloop/2.0.1/node_modules/node-appc/node_modules/wrench/lib/wrench.js:382
var filename = files.shift();
^
TypeError: Cannot read property 'shift' of undefined
at rmFile (/Users/jonahpolack/Library/Application Support/Titanium/plugins/hyperloop/2.0.1/node_modules/node-appc/node_modules/wrench/lib/wrench.js:382:33)
at /Users/jonahpolack/Library/Application Support/Titanium/plugins/hyperloop/2.0.1/node_modules/node-appc/node_modules/wrench/lib/wrench.js:394:11
at FSReqWrap.oncomplete (fs.js:82:15)
So I don't actually use wrench in hyperloop JS code itself, so I think this is actually coming through from the node-appc dependency (as you can see in the file paths above). It's possible that [~hansknoechel]'s PR for node-appc here would fix it? https://github.com/appcelerator/node-appc/pull/122
This was caused by running multiple .aar transforms in parallel. During the transform we copy the assets directory which caused unexpected behavior when multiple I/O operations happened on the same destination folder. PR (master): https://github.com/appcelerator/hyperloop.next/pull/184 PR (2_1_X): https://github.com/appcelerator/hyperloop.next/pull/185
I tested with this environment: Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.2 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.1.1.v20170621181735 Appcelerator Studio, build: 4.9.0.201705302345 Xcode 8.3.2 Hyperloop version 2.1.2 Beta 3 I was able to reproduce the bug using Hyperloop version 2.1.1 and 5 aar files in the project:
I then switched to Hyperloop 2.1.2 Beta 3, and built the same app in succession 10 times, and the error did not occur.