Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gradle version to 8.7 #22206

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open

Update gradle version to 8.7 #22206

wants to merge 56 commits into from

Conversation

jchen351
Copy link
Contributor

@jchen351 jchen351 commented Sep 24, 2024

Description

Update the gradle version from andriod projects to 8.7

And Android gradle build tool to version 7.4.2 across all of the ORT project.

Motivation and Context

Current versions of gradle are inconsistent and outdated to support newer version of plugins such as react-native.
Inconsistent versioning makes upgrading a lot more challenging.

Current issue

  • Android gradle build tool to version 7.4.2 requires JDK 17
  • Increase memory from -Xmx4096M to -Xmx6144M
  • Application crashed during Run React Native Detox Android e2e Tests child-process:SPAWN_STDOUT INSTRUMENTATION_RESULT: shortMsg=Process crashed.
  • Need to update too Android SDK target to 33
  • Android SDK target 33 needs <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
  • Need to force kotlin version to 1.8.10
  • Update FLIPPER_VERSION=0.99.0
  • issue with FlatDir that make the latest.integration does work on "com.microsoft.onnxruntime:onnxruntime-android:latest.integration@aar" anymore
  • org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.xmlconstants/property/accessExternalSchema' is not recognized. Resolution link This is an issue with OpenJDK

AB#50089

java/gradlew.bat Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from this file is generated by ./gradlew wrapper --gradle-version=8.10.2 --distribution-type=bin

@jchen351
Copy link
Contributor Author

All changes from Changes from gradlew and gradlew.bat are generated by ./gradlew wrapper --gradle-version=8.10.2 --distribution-type=bin

@jchen351 jchen351 changed the title Update gradle version to 8.10.2 Update gradle version to 8.6 Sep 24, 2024
@jchen351 jchen351 requested a review from a team as a code owner September 25, 2024 17:47
@@ -13,7 +13,7 @@
#Tue Jan 26 17:36:02 PST 2021
android.enableJetifier=true
android.useAndroidX=true
OnnxruntimeModule_buildToolsVersion=29.0.2
OnnxruntimeModule_buildToolsVersion=30.0.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should we specify the 34+ build tools here if it's going to be forced to that anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this MR, I am only updating the 'com.android.tools.build:gradle:7.4.2' insead of the 'com.android.tools.build:gradle:8.5'. So, the required build tool version is only 30.0.3.

Copy link
Contributor Author

@jchen351 jchen351 Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a separated PR when the com.android.tools.build:gradle is 8.5+ the required version of Android SDK Build Tools then become 34.0.0

@jchen351 jchen351 changed the title Update gradle version to 8.6 Update gradle version to 8.7 Oct 1, 2024
@@ -95,7 +95,7 @@ stages:
--android_sdk_path $ANDROID_HOME \
--android_ndk_path $ANDROID_NDK_HOME \
--android_abi=x86_64 \
--android_api=30 \
--android_api=33 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

Copy link
Contributor Author

@jchen351 jchen351 Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to Application crashed during Run React Native Detox Android e2e Tests child-process:SPAWN_STDOUT INSTRUMENTATION_RESULT: shortMsg=Process crashed.
After searching the on stack overflow we need to update andriod 33+ for newer com.android.tools.build:gradle.
Besides some places already used android 34.
I might need to down grade that to 33, or upgrade everything lese to 34 as well.

jchen351 added a commit that referenced this pull request Nov 15, 2024
…#22771)

### Description
This change is to update the Gradle version within java project to 8.7,
it also upgrades the JAVA to 17. Gradle version from react-native was
also updated to 7.5 to make it compatible with changes from the Java
directory. However, the target java version remains the same. Java
version from these will be upgraded in a separated PR.

This is spited from #22206

### Motivation and Context
This is the first step to upgrade the react native version.
# Conflicts:
#	java/build-android.gradle
#	java/src/test/android/app/build.gradle
#	java/src/test/android/app/src/main/AndroidManifest.xml
#	js/react_native/android/gradle.properties
#	js/react_native/android/gradle/wrapper/gradle-wrapper.jar
#	js/react_native/android/gradle/wrapper/gradle-wrapper.properties
#	js/react_native/android/gradlew
#	js/react_native/android/gradlew.bat
#	tools/ci_build/github/android/build_aar_package.py
#	tools/ci_build/github/android/default_full_aar_build_settings.json
# Conflicts:
#	js/react_native/android/gradle.properties
#	js/react_native/e2e/android/build.gradle
#	js/react_native/e2e/android/gradle/wrapper/gradle-wrapper.properties
#	tools/ci_build/github/android/training_full_aar_build_settings.json
#	tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json
# Conflicts:
#	js/react_native/e2e/android/gradle.properties
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can commit the suggested changes from lintrunner.

Comment on lines 120 to 122
"-no-audio",
"-no-bt", # No Bluetooth
"-no-boot-anim",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"-no-audio",
"-no-bt", # No Bluetooth
"-no-boot-anim",
"-no-audio",
"-no-bt", # No Bluetooth
"-no-boot-anim",

ishwar-raut1 pushed a commit to ishwar-raut1/onnxruntime that referenced this pull request Nov 19, 2024
…microsoft#22771)

### Description
This change is to update the Gradle version within java project to 8.7,
it also upgrades the JAVA to 17. Gradle version from react-native was
also updated to 7.5 to make it compatible with changes from the Java
directory. However, the target java version remains the same. Java
version from these will be upgraded in a separated PR.

This is spited from microsoft#22206

### Motivation and Context
This is the first step to upgrade the react native version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants