[TIMOB-27778] Android: Update gradle build tools to 3.6.x
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-04-02T14:27:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.1 |
Components | Android |
Labels | android, build, gradle, tools |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-02-25T00:00:28.000+0000 |
Updated | 2020-04-02T14:27:44.000+0000 |
Description
*Summary:*
As of Titanium 9.0.0, we're using Android gradle build tool 3.4.2 to build the SDK, apps, and modules.
'com.android.tools.build:gradle:3.4.2'
We should update the tools to version 3.6.x.
https://developer.android.com/studio/releases/gradle-plugin#3-6-0
The newest build tools are supposed to improve APK build times.
https://developer.android.com/studio/releases/gradle-plugin#zipflinger
*Note:*
We should also update our gradle template to 6.0.x which has full support for JDK 13.
https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
https://docs.gradle.org/6.0/release-notes.html
*To-Do:*
We must update the version in the following files...
https://github.com/appcelerator/titanium_mobile/blob/master/android/build.gradle
https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/root.build.gradle
Upgrading will cause the SDK and module builds to fail. The reason is because Google's build tool will now compile C/C++ before Java, which is an issue since our kroll-apt
Java annotation processor generates C++ source files. We can solve this by adding the below to the library project's "build.gradle" file.
project.afterEvaluate {
externalNativeBuildDebug.dependsOn compileDebugJavaWithJavac
externalNativeBuildRelease.dependsOn compileReleaseJavaWithJavac
}
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/build.gradle
https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/module/generated/build.gradle
We will also need to update our gradlew and gradle library folder to the newest version.
https://github.com/appcelerator/titanium_mobile/tree/master/android
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11507 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11510
*Closing ticket.* Fix verified in SDK version 9.1.0.v20200401121418. and 9.0.1.v20200331084758 Test and other information can be found at: PR (master): https://github.com/appcelerator/titanium_mobile/pull/11507 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11510