Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27798

Android: Module build should auto-download NDK if not installed

    Details

    • Story Points:
      3
    • Sprint:
      2020 Sprint 5, 2020 Sprint 8, 2020 Sprint 9

      Description

      Summary:
      Google's gradle tool supports downloading the Android NDK for C/C++ builds. Titanium's module build system should automatically download the NDK in case it's not already installed. This will help reduce tech-support issues.

      Recommended Solution:
      When we upgrade the Android gradle plugin to v3.6.0 or higher, we can specify the exact NDK version we want to download in the build.gradle as follows.
      https://developer.android.com/studio/projects/install-ndk#apply-specific-version

      android {
      	ndkVersion "major.minor.build"
      }
      

      We should do the above if the CLI fails to find the Android NDK path in our _buildModule.js script. In this case, we should also omit the NDK path from the gradle local.properties file here.

      Research Results:
      Using android.ndkVersion to download a specific version (as noted above) appears to be unreliable.
      https://issuetracker.google.com/issues/132876707
      https://stackoverflow.com/questions/60404457/android-no-version-of-ndk-matched-the-requested-version

      Attempting to set this to NDK version 19.2.5345600 causes the following build error.

      No version of NDK matched the requested version 19.2.5345600. Versions available locally: 20.1.5948944
      

      Attempting to set this to NDK version 20.0.5594570 causes the following build error. This appears to be a recent issue.

      No version of NDK matched the requested version 20.0.5594570. Versions available locally: 20.1.5948944
      

      It seems like when new NDK versions get released, older NDK versions appear to stop downloading via gradle (this is speculation). Because of this, we should avoid this feature at the moment. If we don't set the NDK version in gradle, then the gradle build system will download the newest NDK version which has a minor issue noted in TIMOB-27776 but it still works.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
                Tester:
                Sohail Saddique
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration