[TIMOB-28377] Android: Remove deprecated usage of "ndk.dir" in "local.properties" file
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-06-22T15:30:58.000+0000 |
Affected Version/s | Release 9.3.0 |
Fix Version/s | Release 10.0.1 |
Components | Android |
Labels | android, build, ndk |
Reporter | Hans Knöchel |
Assignee | Joshua Quick |
Created | 2021-03-07T21:45:14.000+0000 |
Updated | 2021-06-22T15:30:58.000+0000 |
Description
*Summary:*
As of Titanium 9.3.0, the following deprecation warning will be logged when build an Android app, module, or the Titanium SDK.
> Configure project :titanium
WARNING: NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please delete ndk.dir from local.properties and set android.ndkVersion to [21.3.6528147] in all native modules in the project. https://developer.android.com/r/studio-ui/ndk-dir
NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please delete ndk.dir from local.properties and set android.ndkVersion to [21.3.6528147] in all native modules in the project. https://developer.android.com/r/studio-ui/ndk-dir
*Reason:*
Google has deprecated the "nki.dir" property in the "local.properties" file generated by Titanium.
*Solution:*
To be done on our end...
* Remove our usage of the "ndk.dir" property.
* Drop support of "ANDROID_NDK" environment variable for setting the NDK path.
* Drop support of appc ti config
setting android.ndkPath
.
* Do *NOT* set "build.gradle" setting "android.ndkVersion" in our template and use gradle's default NDK version.
Allow app/module developer to override NDK version used via a custom "build.gradle" file as shown below.
// build.gradle
android {
ndkVersion '21.2.6472646'
}
We're already aware of this. Unfortunately, it's not that simple which is why we haven't done anything about it "yet". Gradle won't automatically download the NDK version we specify if a different NDK version is installed (unlike how everything else works). Gradle will only download the NDK it if you have no NDK installed at all. It's an ugly problem.
I've confirmed that the newest Android gradle build tool now supports downloading/installing an NDK version if a different NDK version is already installed... unless the NDK you want is a major version higher than the default version gradle wants to use (ie: won't currently download NDK 22.x.x since current gradle version defaults to NDK 21.x.x). But this is a lot better than what it was before since it allows downloading older NDK versions upon request.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12711
master and 10_0_X backport merged