diff --git a/README.md b/README.md
index 40e39623f7a..286f23cd66f 100644
--- a/README.md
+++ b/README.md
@@ -115,6 +115,10 @@ The Microsoft Graph SDK is open for contribution. To contribute to this project,
The Microsoft Graph SDK for Java library is supported at runtime for Java 8+ and [Android API revision 26](http://source.android.com/source/build-numbers.html) and greater.
+Android builds require `compileSdk` 37 or later, Android Gradle Plugin 9.1.1 or later with JDK 17 or later, and AndroidX enabled with `android.useAndroidX=true` in `gradle.properties`.
+
+Use a repository that serves Gradle module metadata so the Android OkHttp variant is selected. If only Maven POM metadata is available, exclude the transitive `okhttp-jvm` dependency and add `okhttp-android` explicitly.
+
## 9. License
diff --git a/android/build.gradle b/android/build.gradle
index 25ecad6888c..f221d22858b 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -9,7 +9,7 @@ buildscript {
classpath "com.gradle:gradle-enterprise-gradle-plugin:3.19.2"
classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE"
classpath "com.github.ben-manes:gradle-versions-plugin:0.54.0"
- classpath "com.android.tools.build:gradle:8.13.2"
+ classpath "com.android.tools.build:gradle:9.2.1"
}
}
@@ -25,7 +25,7 @@ apply plugin: "com.github.ManifestClasspath"
android {
namespace 'com.microsoft.graph'
- compileSdkVersion 36
+ compileSdkVersion 37
defaultConfig {
versionCode 1
@@ -56,8 +56,9 @@ android {
disable "ResourceType" // Annotation binding
disable "GradleDependency"
disable "NewerVersionAvailable"
+ disable "OldTargetApi" // The consuming app controls the target SDK.
disable "KotlinPropertyAccess" // getting false positives because of odata actions & functions (getOrder setOrder)
- disable 'AndroidGradlePluginVersion' // We will not be upgrading gradle to version 9 as it does not support our minimum required version of jdk8
+ disable 'AndroidGradlePluginVersion'
}
sourceSets {
main {
@@ -73,15 +74,14 @@ android {
dependencies {
- implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
- api 'com.microsoft.graph:microsoft-graph-core:3.6.6'
+ api 'com.microsoft.graph:microsoft-graph-core:4.0.0'
- implementation 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.9.2'
- implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.9.2'
- implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.9.2'
- implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:1.9.2'
- implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:1.9.2'
- implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:1.9.2'
+ implementation 'com.microsoft.kiota:microsoft-kiota-authentication-azure:2.0.0'
+ api 'com.microsoft.kiota:microsoft-kiota-http-okHttp:2.0.0'
+ implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:2.0.0'
+ implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:2.0.0'
+ implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:2.0.0'
+ implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:2.0.0'
}
diff --git a/android/gradle.properties b/android/gradle.properties
index ea8050294a8..fcdcd22a465 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -22,6 +22,7 @@
org.gradle.jvmargs=-Xmx16g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true
+android.useAndroidX=true
mavenGroupId = com.microsoft.graph
mavenArtifactId = microsoft-graph
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index ff23a68d70f..60d3852ca26 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.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/pom.xml b/pom.xml
index ba735e3acc7..cf7285e955b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -49,10 +49,9 @@
1.8
- 3.6.6
- 4.12.0
+ 4.0.0
2.1.1
- 1.9.2
+ 2.0.0
3.14.0
@@ -87,13 +86,7 @@
microsoft-graph-core
${microsoft-graph-core.version}
-
-
- com.squareup.okhttp3
- okhttp
- ${okhttp.version}
-
-
+
jakarta.annotation
jakarta.annotation-api