Issue description
On Windows Titanium is unable to build, deploy and run app on Android Emulator (either 3.2.3.GA or 3.2.0.GA SDKs).
Steps to reproduce
Create a HelloWorld app (through the File Menu->New->Mobile App Project->Two-tabbed Alloy Application)
Below is the output after trying to debug the application on Android emulator.
Output
[ERROR] Application Installer abnormal process termination. Process exit value was 1
C:\Users\chong1\AppData\Roaming\npm\node_modules\titanium\node_modules\longjohn\dist\longjohn.js:185
throw e;
^
Error: oob
at Buffer.slice (buffer.js:558:32)
at Connection.exec (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:185:26)
at EventEmitter.emit (events.js:96:17)
at TCP.onread (net.js:397:14)
---------------------------------------------
at Connection.exec (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:114:9)
at ADB.devices (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:362:23)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:187:9
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:619:13)
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:623:23)
at list.ontimeout (timers.js:101:19)
---------------------------------------------
at async.whilst.adb.shell.done (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:189:7)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:353:3
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:232:13)
at async.eachSeries.iterate (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:142:25)
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:229:17)
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:556:34)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:297:30
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:551:21)
---------------------------------------------
at Connection.exec (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:114:9)
at ADB.devices (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:362:23)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:187:9
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:619:13)
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:623:23)
at list.ontimeout (timers.js:101:19)
---------------------------------------------
at async.whilst.adb.shell.done (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:189:7)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:353:3
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:232:13)
at async.eachSeries.iterate (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:142:25)
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:229:17)
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:556:34)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:297:30
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:551:21)
---------------------------------------------
at Connection.exec (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:114:9)
at ADB.devices (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:362:23)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:187:9
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:619:13)
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:623:23)
at list.ontimeout (timers.js:101:19)
---------------------------------------------
at async.whilst.adb.shell.done (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:189:7)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:353:3
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:232:13)
at async.eachSeries.iterate (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:142:25)
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:229:17)
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:556:34)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:297:30
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:551:21)
---------------------------------------------
at Connection.exec (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:114:9)
at ADB.devices (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:362:23)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:187:9
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:619:13)
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:623:23)
at list.ontimeout (timers.js:101:19)
---------------------------------------------
at async.whilst.adb.shell.done (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:189:7)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:353:3
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:232:13)
at async.eachSeries.iterate (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:142:25)
at _asyncMap (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:229:17)
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:556:34)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:297:30
at async.series.results (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:551:21)
---------------------------------------------
at Connection.exec (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:114:9)
at ADB.devices (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\adb.js:362:23)
at C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\titanium-sdk\lib\emulator.js:187:9
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:619:13)
at async.whilst (C:\Users\chong1\AppData\Roaming\Titanium\mobilesdk\win32\3.2.3.GA\node_modules\async\lib\async.js:623:23)
at list.ontimeout (timers.js:101:19)
$ java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
CLI
Building from CLI throws:
[ERROR] : Emulator exited with error: 1 [ERROR] : PANIC: Could not open: ANDROID_VIRTUAL_DEVICE_ID [ERROR] Application Installer abnormal process termination. Process exit value was 1
adb probably just got in a wonky state. I would try
adb kill-server
andadb start-server
. I have slightly improved the Android emulator experience in 3.3.0. If you could, you can install Titanium CLI 3.3.0-rc4 with the latest 3.3.X CI build and give it a go. Otherwise, re-test this once 3.3.0 ships and see if the problem has been resolved.[~egomez] Then you must have something wrong with your Android install. "ti info" should return after a few seconds. What version of the Android SDK Tools, Platform Tools, and Build Tools are you using? FYI, on my Mac, I've got 23.0.2, 20, and 20 respectively. Is it possible to kill adb, rename the Android SDK folder, then re-install the Android SDK?
Hi Chris, My Android configuration is identical yours. To recap: Android SDK tools 23.0.2, Platform Tools 20 and Build-Tools 20. Errors persist while building on Windows. Env: CLI 3.3.0 / 3.3.0.GA / Appcelerator Studio 3.3.0 Logs (Studio & CLI): https://gist.github.com/egomez99/9c23d6a922deecd34739 Should I still have a try at the work around TIMOB-17221 to bypass the zip align error? (occurring on CLI only).
[~egomez] Based on the output, the Titanium CLI cannot see the zipalign tool. If you run
ti setup check
, it should say where it thinks zipalign is. It should be in/path/to/android-sdk/build-tools/20.0.0/zipalign
. What type of Android emulator are you trying to launch? ARM? x86? Genymotion?Both ARM & x86. Ironically, Android SDK tools aren't supported on Windows PC:
I've already re-installed Android SDK twice. Do you want me to get it once again or if there is any more info that I could provide, I'd be more than happy to try.
[~egomez] You need to select Titanium SDK 3.3.0.GA:
From the logs I thought it was already enabled. After entering command above the error persists.
[~egomez] After selecting 3.3.0.GA, does
ti setup check
say that the Android tools are now supported?Nope, It doesn't. Same result.
[~egomez] I strongly believe this is a dupe of TIMOB-17344 which I have a fix in for. You should follow the workaround in that ticket. Please try fixing your Genymotion emulators and report back. If the fix indeed does resolved the issue, then I will resolve this ticket as a dupe.
Okay, since x86 & ARM emulators does not seem to be properly detected I can install Genymotion. I will use the work around proposed, if necessary.
If you don't have Genymotion installed, then installing it won't solve your problem. You can try manually applying the changes from https://github.com/appcelerator/titanium_mobile/pull/5913/files and see if it helps.
I can't reproduce this issue. The logic in adb.js has been improved in the past 2 years, so it has either been fixed or it was an issue with an old version of the Android tools.