Skip to content

Commit 7545627

Browse files
authored
fix(android)(9_0_X): module build to download ndk with gradle tool 3.5.0+ (#11620)
- After updating Android gradle tool from 3.4.x to 3.6.0, module builds no longer auto-downloads NDK if missing. - Issue on Google's end which default to an "unstable" NDK version and tool does not support downloading unstable versions. - Downgraded default NDK version for modules from 21.0.6113669 to 20.1.5948944 * Avoids harmless "bad file descriptor" errors that get logged by newest NDK. Fixes TIMOB-27798
1 parent cf4cc22 commit 7545627

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

android/templates/module/generated/build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ preBuild.doFirst {
151151
}
152152
}
153153

154+
// If Titanium failed to set Android NDK path in "local.properties", then assume NDK is not installed.
155+
// Have gradle auto-download NDK by setting the version we want below. (Will fail if a different version is installed.)
156+
// Must be set to a stable release version listed here: https://developer.android.com/ndk/downloads
157+
def localProperties =newProperties()
158+
localProperties.load(file("${rootDir}/local.properties").newDataInputStream())
159+
if (localProperties.get('ndk.dir') ==null) {
160+
android.ndkVersion '20.1.5948944'
161+
}
162+
154163
// Set up project to compile Java side before compiling the C/C++ side.
155164
// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
156165
project.afterEvaluate {

0 commit comments

Comments
 (0)
close