[TIMOB-25865] Android: Build warning appears when Android build-tools v27 or higher is installed
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-06-07T02:40:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | android, build, build-tools |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-03-14T02:43:13.000+0000 |
Updated | 2018-06-22T17:56:22.000+0000 |
Description
*Summary:*
In the Android SDK, if you install build-tools version 27.0.0 or higher and then do an Android build via Titanium, then the following warning message will be logged...
[WARN] : Android Build Tools 27.0.3 are too new and may or may not work with Titanium.
[WARN] : If you encounter problems, select a supported version with:
[WARN] : appc ti config android.buildTools.selectedVersion ##.##.##
[WARN] : where ##.##.## is a version in /Users/user/Library/Android/sdk/build-tools that is 26.x
Android build-tools 27.x.x so far appears to work fine with Titanium builds. So, this warning is harmless for now. But in the future, Google could make breaking changes to their build-tools and we need to protect against this to help future proof our build system.
*Test:*
Open Google's "Android SDK Manager".
Make sure the newest 26.x.x build-tools version is installed.
Make sure the newest 27.x.x build-tools version is installed.
Do a Titanium Android build.
Observe the log for the above mentioned warning.
*Cause:* Titanium currently only supports build-tools version 26.x.x as defined by our "package.json" here... https://github.com/appcelerator/titanium_mobile/blob/master/android/package.json#L25 But the CLI ignores this setting and always uses the newest build-tools version available in the Android SDK instead of using the preferred version defined by our "package.json". This is because the linked code below will return a"maybe"
string instead of true
for a version higher than supported version, but it still evaluates as a positive in the if
condition...
https://github.com/appcelerator/node-titanium-sdk/blob/master/lib/android.js#L768
*Recommended Solution:*
CLI should be changed to favor the build-tools version defined in the "package.json". A newer version outside of this range should only be selected if no preferred version is installed, in which case, the build-tools warning is desired.
We should not make this change until after updating Titanium's "package.json" to support build-tools 27.x.x. This is to avoid a possible breaking change with developers who only have 27.x.x installed. _(Shouldn't cause an issue, but better safe than sorry.)_
PR: https://github.com/appcelerator/node-titanium-sdk/pull/28
FR Passed. Waiting for CR & merge to get enabled.
[~jquick], We will have to make a PR for updating the package.json.
Ticket [TIMOB-25867], which has already been merged in, has a regression. We should either revert it or use my proposed fix for [TIMOB-26099] in 7.3.0. We need to decide before updating the "package.json".
Verified the fix in SDK 7.3.0.v20180618182516. Closing.