http
http copied to clipboard
[native_dio_adapter] Exception fetching LoggerImpl class
This code:
final engine = CronetEngine.build(
cacheMode: CacheMode.memory,
cacheMaxSize: 2 * 1024 * 1024,
userAgent: 'Book Agent',
);
final httpClient = CronetClient.fromCronetEngine(engine);
final response = httpClient
.get(
Uri.https('google.com'),
)
.then((response) => print(response.statusCode));
Issues this error:
D/EGL_emulation( 6658): app_time_stats: avg=2570.07ms min=2570.07ms max=2570.07ms count=1
E/hy ( 6658): Exception fetching LoggerImpl class
E/hy ( 6658): java.lang.ClassNotFoundException: Didn't find class "com.google.net.cronet.telemetry.CronetLoggerImpl" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000002d/CronetDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000002d/CronetDynamite.apk!/lib/x86_64, /data/user_de/0/com.google.android.gms/app_chimera/m/0000002d/CronetDynamite.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/hy ( 6658): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
E/hy ( 6658): at dalvik.system.DelegateLastClassLoader.loadClass(DelegateLastClassLoader.java:199)
E/hy ( 6658): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/hy ( 6658): at org.chromium.net.impl.CronetUrlRequestContext.<init>(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190800-0):90)
E/hy ( 6658): at org.chromium.net.impl.NativeCronetEngineBuilderImpl.build(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190800-0):14)
E/hy ( 6658): at org.chromium.net.CronetEngine$Builder.build(CronetEngine.java:313)
D/EGL_emulation( 6658): app_time_stats: avg=2094.41ms min=2094.41ms max=2094.41ms count=1
I/flutter ( 6658): 200
But the result is successfully retrieved (copy from https://github.com/cfug/dio/issues/2096)
Cronet_http version: ^1.0.0
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.7, on Microsoft Windows [Version 10.0.22631.3007], locale pt-BR)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!