Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23458] Build command should include -d option or support its own flag for Android builds

GitHub Issuen/a
TypeStory
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-07-19T19:05:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsAndroid, Tooling
Labelsn/a
ReporterTim Poulsen (ACV)
AssigneeChee Kiat Ng
Created2016-05-27T13:16:19.000+0000
Updated2016-09-30T23:10:41.000+0000

Description

Scenario: Build an app for android (with ti build or appc run) to device. Switch git branches or take other actions that result in having tiapp.xml set a lower app version number. Try to build again, and you get the following failure:
[INFO]  Installing app on device: SM-G900V
[ERROR] Failed to install apk on "7d4c9760"
[ERROR] Error: INSTALL_FAILED_VERSION_DOWNGRADE
Instead of forcing developers to update the tiapp (which adds complexity to git workflows, like when you're reviewing a co-worker's PR), the build/run command should either automatically include the -d (allow downgrade) on the adb install command it execs, or it should have its own flag to enable that adb option.

Comments

  1. Sharif AbuDarda 2016-05-27

    Hello, I tried to test your issue as you described. First I run an app with "appc run -p android -T device", App runs perfectly in device. Later I changed SDK version to a lower version and-and try running as "appc run -p android -T device". The app run again successfully. Please, explain if I am missing something. Regards, Sharif.
  2. Tim Poulsen (ACV) 2016-05-27

    Sorry, not the SDK version, the *app* version. For example, you create a branch off of master while the app version is 1.5. Shak makes a few changes and now master is at 1.6. He has the app installed on his phone. You submit your PR and he goes to review it. He builds the app and when it gets to the point where the build tools try to install it on his phone, they will fail with the INSTALL_FAILED_VERSION_DOWNGRADE message above.
  3. Tim Poulsen (ACV) 2016-07-19

    PR https://github.com/appcelerator/titanium_mobile/pull/8142
  4. Lokesh Choudhary 2016-09-21

    Verified the fix. The apk installs & does not give INSTALL_FAILED_VERSION_DOWNGRADE error. Closing. Environment: Appc Studio : 4.8.0.201609191928 Ti SDK : 6.0.0.v20160919141738 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-6 Appc CLI : 6.0.0-46 Node: 4.4.4 Nexus 6 - Android 6.0.1

JSON Source