Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27686] Android: Auto-download build system dependencies via gradle

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2020-01-31T11:21:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.0.0
ComponentsAndroid
Labelsandroid, build, gradle, sdk, tools
ReporterJoshua Quick
AssigneeGary Mathews
Created2019-12-14T05:43:03.000+0000
Updated2020-01-31T11:21:58.000+0000

Description

*Summary:* Gradle supports automatically downloading build system related dependencies such as Google's "build-tools" and targeted API Level libraries. We should leverage this feature so that app developer's won't have to download/install them manually via Google's "Android SDK Manager" dialog. This will make building Android apps more convenient and minimize tech-support issues. *Recommended Solution:* Once gradle build support has been added via [TIMOB-19300] in Titanium 9.0.0, we get this feature for free when we start the "gradlew" app build. But in order for this to happen, we need to ignore some of the error results returned by our [node-titanium-sdk](https://github.com/appcelerator/node-titanium-sdk) module's Android detect API [here](https://github.com/appcelerator/node-titanium-sdk/blob/master/lib/android.js) in our Titanium SDK's [_build.js](https://github.com/appcelerator/titanium_mobile/blob/master/android/cli/commands/_build.js) script's validate() function. The error string IDs we need to ignore are: * 'ANDROID_BUILD_TOOLS_TOO_NEW' * 'ANDROID_BUILD_TOOLS_NOT_SUPPORTED' * 'ANDROID_BUILD_TOOLS_CONFIG_SETTING_NOT_INSTALLED' * 'ANDROID_API_TOO_OLD' * 'ANDROID_API_TOO_NEW' * 'ANDROID_NO_APIS' * 'ANDROID_NO_VALID_APIS' * 'ANDROID_SDK_MISSING_PROGRAMS' *Note 1:* We still need our Android SDK/NDK detection code, because there is no way to run the Android gradlew tool without first setting up a "local.properties" file that reference the SDK/NDK directories. *Note 2:* Our Titanium CLI still needs to keep its existing Android tooling detection code since the CLI needs to support Titanium SDK versions older than 9.0.0.

Comments

  1. Gary Mathews 2020-01-14

    master: https://github.com/appcelerator/titanium_mobile/pull/11432
  2. Christopher Williams 2020-01-30

    merged to master for 9.0.0
  3. Samir Mohammed 2020-01-31

    Closing ticket, fix verified in SDK version 9.0.0.v20200130113429 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11432

JSON Source