[TIMOB-27801] Android: Building the SDK should auto-download NDK if not installed
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-06-22T15:29:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.0.1 |
Components | Android |
Labels | android, build, ndk, sdk |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-03-10T23:50:31.000+0000 |
Updated | 2021-06-22T15:29:53.000+0000 |
Description
*Summary:*
Google's gradle tool supports downloading the Android NDK for C/C++ builds. We should let it do so if the Titanium SDK is unable to find the NDK.
*Note:*
Currently, the SDK's
node scons
build scripts will fail the build if it can't find the NDK directory. Instead, it should generate a local.properties
file without the ndk.dir
property.
[createLocalPropertiesFile ()](https://github.com/appcelerator/titanium_mobile/blob/9a3e46dbea8083bce98dbae5c3795f669a2b7928/build/lib/android/index.js#L285)
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11531 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11532
*FR Passed* NDK auto installs if it isn't already installed. Verified with the test case listed on the PR.
The builds fails if NDK not installed
Verified on: Mac OS: 10.15.1 SDK: 9.0.1.v20200408050151, 9.1.0.v20200406120646 Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0
This started happening when we updated Android gradle tool to
3.6.0
via [TIMOB-27778]. This appears to be a bug in Android gradle tool3.6.0
,3.6.1
, and3.6.2
. If anndk.dir
is not provided via a "local.properties" file, then the Android gradle tool defaults to NDK version20.0.5594570
which is an *unstable* release. The gradle tools only supports downloading *stable* releases listed by the links below, which is why it fails. https://developer.android.com/ndk/downloads https://developer.android.com/ndk/downloads/older_releases I'll have to find a work-around.I'm removing this ticket from the release. There doesn't appear to be a reliable way of doing this until Google makes this work better in their Android gradle tool. Although it's less of an issue here since you would normally work on the SDK code via Android Studio and you can easily add the NDK from the IDE.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12711
master and 10_0_X backport merged