Skip to content
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

"JavaCronetEngine: using the fallback Cronet Engine implementation" #1268

Open
lukehutch opened this issue Jul 15, 2024 · 6 comments
Open

"JavaCronetEngine: using the fallback Cronet Engine implementation" #1268

lukehutch opened this issue Jul 15, 2024 · 6 comments
Assignees
Labels
package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lukehutch
Copy link

I get the following error when trying to use Cronet in my Flutter application:

W/JavaCronetEngine(17661): using the fallback Cronet Engine implementation. Performance will suffer and many HTTP client features, including caching, will not work.

No actual reason for the failure to instantiate the native Cronet engine is given.

I try to instantiate Cronet using:

    if (Platform.isAndroid) {
      final engine = CronetEngine.build(
        cacheMode: CacheMode.memory,
        cacheMaxSize: _maxCacheSize,
        enableHttp2: true,
        enableQuic: true,
        userAgent: 'Click',
      );
      return CronetClient.fromCronetEngine(engine);
    }

Expected results

Cronet should work, or if the native Cronet implementation can't be instantiated, a better error message should be shown explaining why.

Flutter Doctor output

Doctor output
$ flutter doctor -v
[✓] Flutter (Channel beta, 3.23.0-0.1.pre, on Fedora Linux 40 (Workstation Edition) 6.8.10-300.fc40.x86_64, locale en_US.utf8)
    • Flutter version 3.23.0-0.1.pre on channel beta at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2feea7a407 (5 weeks ago), 2024-06-06 10:19:10 +0700
    • Engine revision bb10c54666
    • Dart version 3.5.0 (build 3.5.0-180.3.beta)
    • DevTools version 2.36.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/luke/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 18.1.6 (Fedora 18.1.6-3.fc40)
    • cmake version 3.28.2
    • ninja version 1.11.1
    • pkg-config version 2.1.0

[✓] Android Studio (version 2023.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 79.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.91.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.93.20240702

[✓] VS Code (version 1.90.0-insider)
    • VS Code at /usr/share/code-insiders
    • Flutter extension version 3.91.20240529

[✓] Connected device (3 available)
    • Pixel 7 Pro (mobile) • 29161FDH300BLP • android-arm64  • Android 14 (API 34)
    • Linux (desktop)      • linux          • linux-x64      • Fedora Linux 40 (Workstation Edition) 6.8.10-300.fc40.x86_64
    • Chrome (web)         • chrome         • web-javascript • Google Chrome 125.0.6422.112

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@lukehutch lukehutch added package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jul 15, 2024
@brianquinlan
Copy link
Collaborator

Was the "Pixel 7 Pro" the target device that generated that log message?

@lukehutch
Copy link
Author

Yes, I believe so, but this was a long time ago, so I don't remember. If not, it was on the emulator.

@brianquinlan
Copy link
Collaborator

I just wanted to verify that you have play services installed on your device - a Google device will have them installed for sure (unless you replaced the OS) ;-)

@lukehutch
Copy link
Author

Yes, the Pixel 7 Pro has the stock version of Android. I don't mess with custom OS images anymore :)

@lukehutch
Copy link
Author

Maybe a good first step would be improving the error message to give more info on the cause?

@brianquinlan
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants