New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http requests fail with cronetHttpNoPlay=true
with error java.lang.ClassNotFoundException
#1179
Comments
Additional information after some testing: The minimum example provided in https://github.com/dart-lang/http/tree/master/pkgs/cronet_http/example only works when you leave in the line https://github.com/dart-lang/http/blob/master/pkgs/cronet_http/example/android/app/build.gradle#L76 According to the comment in that file, this line should be removed in applications. If you remove that line and run the same example app built with
I'm not sure if you're able to detect whether GPS-Cronet or No-Play-Cronet is then actually used by the application, I unfortunately don't have a test device without Play Services at hand. |
I also reproduce this issue either using It seems that the The app works fine with |
@AlexV525 Did you want to take a look at this? |
It sounds like a obfuscate issue with native methods, but since they actually exported the same entryport the guess might be incorrect. Could anyone try with |
https://developer.android.com/build/multidex#multidexkeepproguard-property might be helpful too. |
With minifyEnabled and shrinkResources disabled, the error no longer occurs for me. |
So the solution we should try is providing the proguard rules that exclude the cronet library. I'll request changes later. Thanks for the feedback. |
Can confirm a
I'm no expert in proguard rules and have not tried to "trim it down" for now. Might be the second line is useless, for example. |
Hello.
I have an app that works fine with
cronet_http
with the GPS-Cronet. Trying to build the same app with--dart-define=cronetHttpNoPlay=true
works, but the app is not usable and throws errors on http requests. The error message reads:pubspec.yaml defines
cronet_http: ^1.2.0
. As no other change is outlined in the documentation, there was no code change from my side anywhere - not sure if I would have to exclude/include something in the Android manifest, gradle build or similar.The app was built with
flutter build apk --split-debug-info=build/app/outputs/symbols/aab --release --dart-define=cronetHttpNoPlay=true
, the test device of the error message is a Samsung Galaxy A52 running the stock OS, but it also fails on a Pixel 8.The text was updated successfully, but these errors were encountered: