From f3dafed06f64f926c8354ffe3915b9e32f409d84 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 10 Dec 2024 11:10:10 -0800 Subject: [PATCH 1/2] Upgrade Java version from react-native/android to Java 17 --- js/react_native/android/build.gradle | 4 ++-- js/react_native/android/gradle.properties | 8 ++++++-- .../github/android/default_qnn_aar_build_settings.json | 4 ++-- .../github/android/training_full_aar_build_settings.json | 4 ++-- .../js/react_native_e2e_full_aar_build_settings.json | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/js/react_native/android/build.gradle b/js/react_native/android/build.gradle index 521866ff0f3e2..df5792d274592 100644 --- a/js/react_native/android/build.gradle +++ b/js/react_native/android/build.gradle @@ -127,8 +127,8 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } sourceSets { diff --git a/js/react_native/android/gradle.properties b/js/react_native/android/gradle.properties index 8fe6e40d76911..627c18563ea7e 100644 --- a/js/react_native/android/gradle.properties +++ b/js/react_native/android/gradle.properties @@ -4,7 +4,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx1024m -XX:MaxPermSize=256m -org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=all # # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -15,5 +15,9 @@ android.enableJetifier=true android.useAndroidX=true OnnxruntimeModule_buildToolsVersion=29.0.2 OnnxruntimeModule_compileSdkVersion=31 -OnnxruntimeModule_minSdkVersion=21 +OnnxruntimeModule_minSdkVersion=24 OnnxruntimeModule_targetSdkVersion=31 + +systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl +systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl +systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl diff --git a/tools/ci_build/github/android/default_qnn_aar_build_settings.json b/tools/ci_build/github/android/default_qnn_aar_build_settings.json index 599c108f830e7..a2ffc45e223ed 100644 --- a/tools/ci_build/github/android/default_qnn_aar_build_settings.json +++ b/tools/ci_build/github/android/default_qnn_aar_build_settings.json @@ -2,8 +2,8 @@ "build_abis": [ "arm64-v8a" ], - "android_min_sdk_version": 21, - "android_target_sdk_version": 24, + "android_min_sdk_version": 24, + "android_target_sdk_version": 31, "build_params": [ "--enable_lto", "--android", diff --git a/tools/ci_build/github/android/training_full_aar_build_settings.json b/tools/ci_build/github/android/training_full_aar_build_settings.json index 013804e2d63e9..6f77c1f3dce11 100644 --- a/tools/ci_build/github/android/training_full_aar_build_settings.json +++ b/tools/ci_build/github/android/training_full_aar_build_settings.json @@ -5,8 +5,8 @@ "x86", "x86_64" ], - "android_min_sdk_version": 21, - "android_target_sdk_version": 24, + "android_min_sdk_version": 24, + "android_target_sdk_version": 31, "build_params": [ "--enable_lto", "--android", diff --git a/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json b/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json index 3e755ab5aa9db..85d8b1f3d453c 100644 --- a/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json +++ b/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json @@ -2,8 +2,8 @@ "build_abis": [ "x86_64" ], - "android_min_sdk_version": 21, - "android_target_sdk_version": 24, + "android_min_sdk_version": 24, + "android_target_sdk_version": 31, "build_params": [ "--android", "--parallel", From 07713a59f95ae21bf74b2f9005487ed3b4f20042 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 19 Dec 2024 16:27:08 -0800 Subject: [PATCH 2/2] Update minSdkVersion to 24 --- js/react_native/e2e/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/react_native/e2e/android/build.gradle b/js/react_native/e2e/android/build.gradle index 5932dfc5695d6..895ed0f7a8cc3 100644 --- a/js/react_native/e2e/android/build.gradle +++ b/js/react_native/e2e/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { buildToolsVersion = "29.0.2" - minSdkVersion = 21 + minSdkVersion = 24 compileSdkVersion = 31 targetSdkVersion = 31 kotlinVersion = "1.5.30"