Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18113] Android: Feature Request to select the Android Build Tools version

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-02-13T22:18:13.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsAndroid, CLI
Labelsn/a
ReporterEduardo Gomez
AssigneeTim Poulsen
Created2014-12-01T18:27:51.000+0000
Updated2017-03-16T22:51:01.000+0000

Description

Feature Request Description

It would be great if you could set this as a feature request for the 3.5.0 or 3.5.1 TiSDK. I anticipate that having this ability would reduce the number of different build environments that we would have to maintain and would allow us to upgrade our Android versions at a faster pace. The request would be to select the Android Build Tools version when launching the ti build command via a parameter.

Use Case

The scenario is as follows. Suppose we have a app 3.4 which is GA'd against the 3.4.1.GA TiSDK Android-18 Target SDK, and the Android 19.1.0 Build Tools. We are now working on our app 3.5 project and want to upgrade to TI 3.5.0.GA and the Android Target SDK to 21 for Android 5.0 support. For Android 5.0 support we have to use build tools 21.0.0. I was wondering if there is a way at build time to select 19.1.0 for the 3.4 app and the 21.0.0 for the 3.5 app via some build time parameter.

Comments

  1. Ingo Muschenetz 2014-12-01

    Is there a reason you couldn't use build tools 21 for all versions?
  2. Chris Barber 2014-12-03

    We should definitely support this. Right now, the Android detection code in the Titanium SDK (node_modules/titanium-sdk/lib/android.js) gets the highest version of platform tools and build tools. The current code will need some cleaning up. This logic should take into account the supported build/platform tools defined in the Android platform's package.json vendorDependencies. This will make sure that only the latest supported versions are selected by default. Then these versions should be overridden by the "android.platformTools.selectedVersion" and "android.buildTools.selectedVersion". The actual code would look like:
       latestPlatformToolsVersion = versions.sort().shift();
       config.get('android.platformTools.selectedVersion', latestPlatformToolsVersion)
       
  3. Chris Barber 2015-01-21

    [~skypanther] Because this is similar to how Windows works with Visual Studio and Windows Phone SDK selection. Remember that the versions detected should excluded versions that aren't supported and we only pick the latest if it hasn't been globally set. Ideally we should have a consistent way of having global, project, and build-level settings, but we sorta don't.
  4. Tim Poulsen 2015-01-22

    PR: https://github.com/appcelerator/titanium_mobile/pull/6593 Functional review steps: 1. Determine which build tools are available in your Android SDK (e.g. these are the dir names in ~/android-sdk/build-tools/) 2. Configure the selected build tools version with ti config android.buildTools.selectedVersion 20.0.0 where the last arg is an installed, but not newest, build tools version 3. Enter ti config and confirm that the value was set. 4. Create and build a Titanium app for Android and watch the output for a reference in the console output to the build tools version, such as \[INFO\] Packaging application: /android-sdk/build-tools/20.0.0/aapt .... You can cancel the build at this point. 5. Remove the config setting with ti config -r android.buildTools.selectedVersion 6. Enter ti config and confirm that the value was removed. 7. Clean, the build your app again. Look for the build tools version in the log output; it should be the highest version installed on your system. 8. Set the selected build tools version to the earliest installed on your system; install a pre-18 version if necessary. Attempt to build the app. You should receive a warning that you're using an outdated version.
  5. Tim Poulsen 2015-01-23

    PR updated incorporating feedback from Chris: CLI now uses either the selected version, or the newest, supported auto-detected version. (Prior to this ticket, the CLI always used the newest version whether supported or not). If the selected version doesn't exist or is unsupported, gives the same error messages as you'd get previously if no SDK installed, missing executables, etc.
  6. Tim Poulsen 2015-02-02

    See additional comments on the PR.
  7. Tim Poulsen 2015-02-13

    See final comments on PR. Merged.
  8. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source