diff --git a/android/build.gradle b/android/build.gradle index 69907029804..f7d88970600 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,6 +5,8 @@ * Please see the LICENSE included with this distribution for details. */ +apply from: 'untar.gradle' + buildscript { ext.kotlin_version = '2.3.0' @@ -13,7 +15,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.13.2' + classpath 'com.android.tools.build:gradle:9.1.0' classpath 'com.google.gms:google-services:4.4.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.codehaus.groovy:groovy-json:3.0.17' diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js index e3b90f34568..3d29239050d 100644 --- a/android/cli/commands/_build.js +++ b/android/cli/commands/_build.js @@ -2228,6 +2228,8 @@ class AndroidBuilder extends Builder { gradleProperties.push({ key: 'android.nonTransitiveRClass', value: 'false' }); gradleProperties.push({ key: 'org.gradle.jvmargs', value: `-Xmx${this.javacMaxMemory}` }); gradleProperties.push({ key: 'org.gradle.configuration-cache', value: 'true' }); + gradleProperties.push({ key: 'android.builtInKotlin', value: 'false' }); + gradleProperties.push({ key: 'android.newDsl', value: 'false' }); await gradlew.writeGradlePropertiesFile(gradleProperties); // Copy optional "gradle.properties" file contents from Titanium project to the above generated file. diff --git a/android/cli/commands/_buildModule.js b/android/cli/commands/_buildModule.js index 130b53caa54..1362020fec4 100644 --- a/android/cli/commands/_buildModule.js +++ b/android/cli/commands/_buildModule.js @@ -523,6 +523,8 @@ export class AndroidModuleBuilder extends Builder { gradleProperties.push({ key: 'android.useAndroidX', value: 'true' }); gradleProperties.push({ key: 'android.suppressUnsupportedCompileSdk', value: '35' }); gradleProperties.push({ key: 'android.nonTransitiveRClass', value: 'false' }); + gradleProperties.push({ key: 'android.builtInKotlin', value: 'false' }); + gradleProperties.push({ key: 'android.newDsl', value: 'false' }); gradleProperties.push({ key: 'org.gradle.jvmargs', value: `-Xmx${this.javacMaxMemory} -Dkotlin.daemon.jvm.options="-Xmx${this.javacMaxMemory}"` diff --git a/android/gradle.properties b/android/gradle.properties index 0060c7f913b..e9ca630f63f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -6,7 +6,10 @@ # -------------------------------------------------------------------------------- # Set max Java heap size for Gradle daemon process. -org.gradle.jvmargs=-Xmx1536m +org.gradle.jvmargs=-Xmx2g + +# Enable parallel build execution +org.gradle.parallel=true # Enable usage of Google's AndroidX libraries. # Note: Jetifier is not needed for test app since it doesn't use Google's deprecated support libraries. @@ -14,3 +17,7 @@ android.useAndroidX=true android.enableJetifier=false android.nonTransitiveRClass=false android.suppressUnsupportedCompileSdk=35 + +# opt-out of build in kotlin (v9 feature) - need to be changed for Gradle 10 (smae in _build/_buildModule) +android.builtInKotlin=false +android.newDsl=false diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 7705927e949..5be30bbeb24 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/android/gradlew.bat b/android/gradlew.bat index d8362afbfa2..5eed7ee8452 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -23,7 +23,7 @@ @rem @rem ########################################################################## -@rem Set local scope for the variables with Windows NT shell +@rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 @@ -77,7 +77,7 @@ set CLASSPATH= "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end -@rem End local scope for the variables with Windows NT shell +@rem End local scope for the variables with windows NT shell if %ERRORLEVEL% equ 0 goto mainEnd :fail diff --git a/android/templates/build/root.build.gradle b/android/templates/build/root.build.gradle index 82d855a64c7..46ec4283269 100644 --- a/android/templates/build/root.build.gradle +++ b/android/templates/build/root.build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.13.2' + classpath 'com.android.tools.build:gradle:9.1.0' classpath 'com.google.gms:google-services:4.4.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" <% for (let i = 0; i < classpaths.length; i++) {%> diff --git a/android/titanium/libv8-services.js b/android/titanium/libv8-services.js index bad75afa368..dea05922367 100644 --- a/android/titanium/libv8-services.js +++ b/android/titanium/libv8-services.js @@ -255,7 +255,7 @@ async function updateLibrary() { console.log(`Decompressing downloaded V8 file: ${inFile}`); const untarCommandLine = quotePath(path.join(__dirname, '..', isWindows ? 'gradlew.bat' : 'gradlew')) - + ' -b ' + quotePath(path.join(__dirname, '..', 'untar.gradle')) + + ' -p ' + quotePath(path.join(__dirname, '..')) + ' -Pcompression=bzip2' + ' -Psrc=' + quotePath(inFile) + ' -Pdest=' + quotePath(outDir);