android.ndkVersion is ignored in some modules

39 views
Skip to first unread message

Matt Blair

unread,
Apr 19, 2021, 1:15:13 PMApr 19
to android-ndk

I have an Android project containing 1) a library that builds C++ code via CMake and 2) a demo app that uses the library. The project source is here: https://github.com/tangrams/tangram-es/tree/main/platforms/android ('tangram' is the library module and 'demo' is the app).

I want to specify an NDK version or path for the library. According to https://developer.android.com/studio/projects/configure-agp-ndk?language=agp4-1 it seems like I should be able to do this by setting `android.ndkVersion` or `android.ndkPath` in the relevant module.

If I add a `ndkVersion` to the `android` block in tangram/build.gradle, the value is ignored. In the debug output from Gradle I see this line:
```
2021-04-18T16:33:28.326-0400 [INFO] [com.android.build.gradle.internal.cxx.logging.IssueReporterLoggingEnvironment] android.ndkVersion from module build.gradle is [not set]
```

However, if I add a `ndkVersion` to the `android` block in demo/build.gradle, the value is used as expected:
```
2021-04-18T16:50:52.288-0400 [INFO] [com.android.build.gradle.internal.cxx.logging.IssueReporterLoggingEnvironment] android.ndkVersion from module build.gradle is [21.1.6352462]
```
This is surprising, since the demo module has no native code. Is this a bug, or is there something I am not understanding about how this property is applied?
Reply all
Reply to author
Forward
0 new messages