[TIMOB-27755] Android: Add NDK side-by-side support
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-04-15T18:03:17.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.1 |
Components | Android, CLI |
Labels | android, build, ndk, sdk |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-02-08T04:45:57.000+0000 |
Updated | 2020-04-15T18:03:17.000+0000 |
Description
*Summary:*
As of 2019, Google introduced a new NDK "side-by-side" feature which allows you to install multiple NDK versions under the Android SDK directory. All new NDK versions are downloaded to the side-by-side directory and it replaces the old "ndk-bundle" directory.
*Example:*
The folder structure appear as follows on macOS...
~/Library/Android/sdk/ndk/19.2.5345600
~/Library/Android/sdk/ndk/20.1.5948922
~/Library/Android/sdk/ndk/21.0.5935234
~/Library/Android/sdk/ndk/21.0.6113669
There will be an "ndk" directory under the "Android/sdk" directory. Each subdirectory under "ndk" will be the version number of the installed NDK.
*Old Behavior:*
Before the NDK side-by-side feature existed, Android Studio used to install the NDK under the Android SDK directory as shown below. Updating the NDK version used to replace the old version. Android Studio no longer installs to this directory.
~/Library/Android/sdk/ndk-bundle
*To be done:*
The CLI should search for the installed NDK directory in the following order.
PR: https://github.com/appcelerator/node-titanium-sdk/pull/143 PR: https://github.com/appcelerator/node-titanium-sdk/pull/186
In our current
9_0_X
branch, after the9.0.0.GA
release, app builds will fail if you do the following.Uninstall NDK if currently installed.
Open Android Studio's preferences window.
Go to: Appearances & Behavior -> System Settings -> Android SDK
Click on the "SDK Tools" tab.
Check the "NDK (Side by side)" option.
Click the OK button.
Attempt to build a Titanium app.
This ticket solves this issue because Titanium will correctly find the Android Studio installed NDK and provide it to the app build. *Notes:* - The app will build successfully if you do not have the NDK installed. You will get a warning about the NDK being missing instead. - Google requires the NDK because the app includes C/C++ libraries and wants to strip debug symbols from them. This is something they changed as of Android gradle tool v3.5.0.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11627 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11626
FR Passed. Waiting for Jenkins build on master.
PR's Merged.
Verified on: Mac OS: 10.15.4 SDK: 9.0.1.v20200415071927, 9.1.0.v20200415075143 Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202003181504 Device: Pixel3(v10.0) emulator,