Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25742] CLI: Fails to install APK to Android 4.1 devices

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-02-16T22:02:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labelsandroid, appc, cli
ReporterJoshua Quick
AssigneeJoshua Quick
Created2018-02-02T01:17:47.000+0000
Updated2018-03-01T19:24:50.000+0000

Description

*Summary:* The "appc" command line tool always fails to install a built APK to an Android 4.1 device. It can only successfully install to Android 4.2 and higher. *How to Reproduce:*

Connect an Android 4.1 device to your machine.

In the top-left corner of Appcelerator Studio, select "Run" and the Android 4.1 device from the drop-down UI.

Click the "Run" button.

Observe the "Console" log.

_Alternatively, you can do this at the command line via..._
appc run -p android
*Result:* The install fails after the build with the following error messages...
[ERROR] :  Failed to install apk on "014E05E01600E012"
[ERROR] Application Installer abnormal process termination. Process exit value was 1
*Cause:* The CLI is installing the APK using Google's "adb" command line tool with the "-d" argument. Android 4.1 does not support the "-d" argument. https://github.com/appcelerator/node-titanium-sdk/blob/master/lib/adb.js#L548 *Recommended Solution:* The "adb" command line does not return an error until near the end of the install, which can take a lot of time for large APKs. So, it would be best to fetch the API Level from the device first via the "adb shell getprop" command and then only use "adb install" with argument "-d" if the API Level is 17 or higher.

Comments

  1. Joshua Quick 2018-02-02

    PR: https://github.com/appcelerator/node-titanium-sdk/pull/22
  2. Abir Mukherjee 2018-02-16

    Need to validate the fix before closing after next CLI release (CLI 7.0.3 or later).
  3. Abir Mukherjee 2018-03-01

    Validated with 7.0.2 from the CLI.

JSON Source