diff --git a/pkgs/cronet_http/CHANGELOG.md b/pkgs/cronet_http/CHANGELOG.md index d5577055e5..2a5afb4897 100644 --- a/pkgs/cronet_http/CHANGELOG.md +++ b/pkgs/cronet_http/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.6.1-wip + +* Fix a bug where cronet would throw `ClassNotFoundException` in debug mode. + ## 1.6.0 * Upgrade the `cronet-embedded` dependency to `141.7340` version to diff --git a/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt b/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt index 23c3100f7a..584071817e 100644 --- a/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt +++ b/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt @@ -14,6 +14,7 @@ package io.flutter.plugins.cronet_http +import androidx.annotation.Keep import org.chromium.net.CronetException import org.chromium.net.UrlRequest import org.chromium.net.UrlResponseInfo @@ -31,8 +32,10 @@ import java.nio.ByteBuffer // parameter is nullable as specified in the cronet source code: // https://source.chromium.org/chromium/chromium/src/+/main:components/cronet/android/api/src/org/chromium/net/UrlRequest.java;l=232 +@Keep class UrlRequestCallbackProxy(val callback: UrlRequestCallbackInterface) : UrlRequest.Callback() { - public interface UrlRequestCallbackInterface { + @Keep + interface UrlRequestCallbackInterface { fun onRedirectReceived( request: UrlRequest?, info: UrlResponseInfo?, diff --git a/pkgs/cronet_http/pubspec.yaml b/pkgs/cronet_http/pubspec.yaml index 258f01ec9c..986b50b1dd 100644 --- a/pkgs/cronet_http/pubspec.yaml +++ b/pkgs/cronet_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cronet_http -version: 1.6.0 +version: 1.6.1-wip description: >- An Android Flutter plugin that provides access to the Cronet HTTP client. repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http