From ec9f512fee7004fb440f08c983eab121f823455b Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 25 Jun 2021 15:13:36 +0100 Subject: [PATCH] OkHttp: Upgrade to 4.9.1 (minSdkVersion 21) Until now, we have stuck with the 3.12 long-term branch so as to keep support for older API levels. However, this means that the version we're using is 2.5 years old at this point. The 3.12 branch will stop receiving critical updates in December 2021. Since use of the OkHttp extension is optional anyway, it seems preferable to move to a modern version of OkHttp at this point. PiperOrigin-RevId: 381465269 --- RELEASENOTES.md | 3 +++ extensions/okhttp/build.gradle | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e4f845c04e..3fec448ca5 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -109,6 +109,9 @@ * Fix session description (SDP) parsing to use a HashMap-like behaviour for duplicated attributes. ([#9014](https://github.com/google/ExoPlayer/issues/9014)). +* OkHttp extension: + * Switch to OkHttp 4.9.1. This increases the extension's minimum SDK + version requirement from 16 to 21. ### 2.14.1 (2021-06-11) diff --git a/extensions/okhttp/build.gradle b/extensions/okhttp/build.gradle index 758eb646f6..7589633208 100644 --- a/extensions/okhttp/build.gradle +++ b/extensions/okhttp/build.gradle @@ -13,6 +13,8 @@ // limitations under the License. apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" +android.defaultConfig.minSdkVersion 21 + dependencies { implementation project(modulePrefix + 'library-common') implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion @@ -21,11 +23,7 @@ dependencies { testImplementation project(modulePrefix + 'testutils') testImplementation 'com.squareup.okhttp3:mockwebserver:' + mockWebServerVersion testImplementation 'org.robolectric:robolectric:' + robolectricVersion - // Do not update to 3.13.X or later until minSdkVersion is increased to 21: - // https://cashapp.github.io/2019-02-05/okhttp-3-13-requires-android-5 - // Since OkHttp is distributed as a jar rather than an aar, Gradle won't - // stop us from making this mistake! - api 'com.squareup.okhttp3:okhttp:3.12.11' + api 'com.squareup.okhttp3:okhttp:4.9.1' } ext {