{ "id": "174801", "key": "TIMOB-27798", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21018", "name": "Release 9.0.2", "archived": false, "released": true, "releaseDate": "2020-05-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-05-05T23:25:09.000+0000", "created": "2020-03-10T18:42:35.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "build", "gradle", "module", "ndk" ], "versions": [], "issuelinks": [ { "id": "58258", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "174806", "key": "TIMOB-27801", "fields": { "summary": "Android: Building the SDK should auto-download NDK if not installed", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-05-05T23:25:09.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nGoogle'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.\r\n\r\n*Recommended Solution:*\r\nWhen 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.\r\nhttps://developer.android.com/studio/projects/install-ndk#apply-specific-version\r\n{code:groovy}\r\nandroid {\r\n\tndkVersion \"major.minor.build\"\r\n}\r\n{code}\r\n\r\nWe should do the above if the CLI fails to find the Android NDK path in our [_buildModule.js|https://github.com/appcelerator/titanium_mobile/blob/master/android/cli/commands/_buildModule.js] script. In this case, we should also omit the NDK path from the gradle {{local.properties}} file [here|https://github.com/appcelerator/titanium_mobile/blob/master/android/cli/commands/_buildModule.js#L517].\r\n\r\n*Research Results:*\r\nUsing {{android.ndkVersion}} to download a specific version (as noted above) appears to be unreliable.\r\nhttps://issuetracker.google.com/issues/132876707\r\nhttps://stackoverflow.com/questions/60404457/android-no-version-of-ndk-matched-the-requested-version\r\n\r\nAttempting to set this to NDK version {{19.2.5345600}} causes the following build error.\r\n{code}\r\nNo version of NDK matched the requested version 19.2.5345600. Versions available locally: 20.1.5948944\r\n{code}\r\n\r\nAttempting to set this to NDK version {{20.0.5594570}} causes the following build error. This appears to be a recent issue.\r\n{code}\r\nNo version of NDK matched the requested version 20.0.5594570. Versions available locally: 20.1.5948944\r\n{code}\r\n\r\nIt 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.\r\n", "attachment": [], "flagged": false, "summary": "Android: Module build should auto-download NDK if not installed", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1192, "state": "closed", "name": "2020 Sprint 8", "startDate": "2020-04-10T18:08:36.092Z", "endDate": "2020-04-24T18:08:00.000Z", "completeDate": "2020-04-24T16:23:30.466Z", "originBoardId": 114 }, { "id": 1194, "state": "closed", "name": "2020 Sprint 9", "startDate": "2020-04-24T17:09:51.572Z", "endDate": "2020-05-08T17:09:00.000Z", "completeDate": "2020-05-08T15:40:07.869Z", "originBoardId": 114 }, { "id": 1181, "state": "closed", "name": "2020 Sprint 5", "startDate": "2020-03-02T18:45:02.513Z", "endDate": "2020-03-13T18:45:00.000Z", "completeDate": "2020-03-13T16:42:04.632Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "454650", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11531\r\nPR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11532\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-03-11T01:26:32.000+0000", "updated": "2020-03-11T01:26:32.000+0000" }, { "id": "454766", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "*FR Passed*\r\n\r\nNDK auto installs if it isn't already installed. Verified with the test case listed on the PR.\r\n\r\nWaiting to merge PR.", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-03-19T14:04:44.000+0000", "updated": "2020-03-19T14:04:44.000+0000" }, { "id": "454784", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "PR's merged.", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-03-20T14:40:59.000+0000", "updated": "2020-03-20T14:41:42.000+0000" }, { "id": "454947", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Currently on Catalina Beta 1 (10.15.1 Beta (19B68f)) I see the following issue when following the test steps below: (I will add to this when I update to newest beta of Catalina and when I have done a fresh install of Android studio and its tools). \r\n\r\n# Use a machine that does not have the NDK installed.\r\n# Download the zipped source of module ti.nfc\r\n# Open the Terminal.\r\n# CD to android directory within the module \r\n# Enter: appc run -p android\r\n# Verify that you see log message similar to the below. This may take a few minutes.\r\n# [INFO] [GRADLE] Preparing \"Install NDK (revision: 21.0.6113669)\"\r\n# Verify that the module builds and its example project runs.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-02T16:46:39.000+0000", "updated": "2020-04-02T16:46:39.000+0000" }, { "id": "455030", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The builds fails if NDK not installed\r\n\r\n{code:java}\r\n[INFO] [GRADLE] WARNING: Compatible side by side NDK version was not found. Default is 20.0.5594570.\r\n[INFO] [GRADLE] Compatible side by side NDK version was not found. Default is 20.0.5594570.\r\n[ERROR] [GRADLE] \r\n[ERROR] [GRADLE] FAILURE: Build failed with an exception.\r\n[ERROR] [GRADLE] \r\n[ERROR] [GRADLE] * What went wrong:\r\n[ERROR] [GRADLE] A problem occurred configuring project ':module'.\r\n[ERROR] [GRADLE] > Failed to notify project evaluation listener.\r\n[ERROR] [GRADLE] > NDK not configured. Download it with SDK manager. Preferred NDK version is '20.0.5594570'. Log: /Users/satyamsekhri/Documents/GitRepos/ti.imagefactory-stable/android/build/module/.cxx/ndk_locator_record.json\r\n[ERROR] [GRADLE] > Could not get unknown property 'externalNativeBuildDebug' for project ':module' of type org.gradle.api.Project.\r\n[ERROR] [GRADLE] \r\n[ERROR] [GRADLE] * Try:\r\n[ERROR] [GRADLE] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.\r\n[ERROR] [GRADLE] \r\n[ERROR] [GRADLE] * Get more help at https://help.gradle.org\r\n[ERROR] [GRADLE] \r\n[ERROR] [GRADLE] BUILD FAILED in 897ms\r\n[ERROR] \"gradlew\" tool returned exit code: 1\r\n[ERROR] An error occurred during build after 2s 441ms\r\n[ERROR] \"gradlew\" tool returned exit code: 1\r\n{code}\r\n\r\nVerified on:\r\nMac OS: 10.15.1\r\nSDK: 9.0.1.v20200408050151, 9.1.0.v20200406120646\r\nAppc CLI: 8.0.0\r\nJDK: 11.0.4\r\nNode: 10.17.0", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-08T20:38:04.000+0000", "updated": "2020-04-08T20:38:04.000+0000" }, { "id": "455032", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This started happening when we updated Android gradle tool to {{3.6.0}} via [TIMOB-27778].\r\n\r\nThis appears to be a bug in Android gradle tool {{3.6.0}}, {{3.6.1}}, and {{3.6.2}}. If an {{ndk.dir}} is not provided via a \"local.properties\" file, then the Android gradle tool defaults to NDK version {{20.0.5594570}} which is an *unstable* release. The gradle tools only supports downloading *stable* releases listed by the links below, which is why it fails.\r\nhttps://developer.android.com/ndk/downloads\r\nhttps://developer.android.com/ndk/downloads/older_releases\r\n\r\nI'll have to find a work-around.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-08T22:48:18.000+0000", "updated": "2020-04-08T23:02:41.000+0000" }, { "id": "455063", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Since Google's default NDK version is an unstable version, we can work-around it by hard-coding the NDK version ourselves in gradle like the below, but this has its own issues too.\r\n{code:groovy}\r\nandroid {\r\n\tndkVersion '21.0.6113669'\r\n}\r\n{code}\r\n\r\nThe above will only download the NDK if no other NDK versions are installed. If you have one or more NDK versions installed that don't match the requested versions, then Google's gradle tool will *NOT* download the requested version and will trigger a build failure.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-09T18:36:43.000+0000", "updated": "2020-04-09T18:36:43.000+0000" }, { "id": "455070", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11613\r\nPR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11620", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-09T23:46:55.000+0000", "updated": "2020-04-10T21:24:39.000+0000" }, { "id": "455309", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\n1. With no NDK on the system, the module build installs side-by-side NDK\r\n2. When side-by-side NDK (any other version) is already installed the module build does not install the NDK\r\n3. When side-by-side NDK is not installed but another NDK is on the system. \"appc ti config\" does not have flag for android.ndkPath set then the build for module installs side-by-side NDK.\r\n4. When side-by-side NDK is not installed but another NDK is on the system. \"appc ti config\" flag for android.ndkPath is set to the NDK on the system then the module build does not install side-by-side NDK.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-30T03:45:10.000+0000", "updated": "2020-04-30T03:45:10.000+0000" }, { "id": "455310", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Waiting on Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-30T03:45:26.000+0000", "updated": "2020-04-30T03:45:26.000+0000" }, { "id": "455318", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to 9_0_X for 9.0.2 target and master for 9.1.0 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-04-30T18:02:07.000+0000", "updated": "2020-04-30T18:02:15.000+0000" }, { "id": "455374", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Side-by-side NDK installed when building a module.\r\nAlso the titanium app and module builds successfully when no NDK is installed previously and also when side-by-side NDK of another version is already installed.\r\n\r\nVerified on:\r\nMac OS: 10.15.4\r\nSDK: 9.1.0.v20200505112143, 9.0.2.v20200505111803\r\nAppc CLI: 8.0.0\r\nJDK: 11.0.6\r\nNode: 10.17.0", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-05T23:25:09.000+0000", "updated": "2020-05-05T23:25:09.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }