Skip to content

Commit 5ec2476

Browse files
[cronet_http] Fix ClassNotFoundException in debug mode (#1840)
* [cronet_http] Fix `ClassNotFoundException` in debug mode * Update changelog
1 parent 3500364 commit 5ec2476

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

pkgs/cronet_http/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.6.1-wip
2+
3+
* Fix a bug where cronet would throw `ClassNotFoundException` in debug mode.
4+
15
## 1.6.0
26

37
* Upgrade the `cronet-embedded` dependency to `141.7340` version to

pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
package io.flutter.plugins.cronet_http
1616

17+
import androidx.annotation.Keep
1718
import org.chromium.net.CronetException
1819
import org.chromium.net.UrlRequest
1920
import org.chromium.net.UrlResponseInfo
@@ -31,8 +32,10 @@ import java.nio.ByteBuffer
3132
// parameter is nullable as specified in the cronet source code:
3233
// https://source.chromium.org/chromium/chromium/src/+/main:components/cronet/android/api/src/org/chromium/net/UrlRequest.java;l=232
3334

35+
@Keep
3436
class UrlRequestCallbackProxy(val callback: UrlRequestCallbackInterface) : UrlRequest.Callback() {
35-
public interface UrlRequestCallbackInterface {
37+
@Keep
38+
interface UrlRequestCallbackInterface {
3639
fun onRedirectReceived(
3740
request: UrlRequest?,
3841
info: UrlResponseInfo?,

pkgs/cronet_http/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: cronet_http
2-
version: 1.6.0
2+
version: 1.6.1-wip
33
description: >-
44
An Android Flutter plugin that provides access to the Cronet HTTP client.
55
repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http

0 commit comments

Comments
 (0)