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

[native_dio_adapter] Exception fetching LoggerImpl class #2096

Closed
JCKodel opened this issue Jan 13, 2024 · 4 comments
Closed

[native_dio_adapter] Exception fetching LoggerImpl class #2096

JCKodel opened this issue Jan 13, 2024 · 4 comments
Labels
i: out of support p: dependency Targeting packages that's used by dio packages

Comments

@JCKodel
Copy link

JCKodel commented Jan 13, 2024

Package

native_dio_adapter

Version

1.3.0

Operating-System

Android

Output of flutter doctor -v

[!] Flutter (Channel stable, 3.16.7, on Microsoft Windows [Version 10.0.22631.3007], locale pt-BR)
    • Flutter version 3.16.7 on channel stable at C:\Users\jckod\fvm\default
    ! Warning: `flutter` on your path resolves to C:\Users\jckod\fvm\versions\3.16.7\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\jckod\fvm\default. Consider adding
      C:\Users\jckod\fvm\default\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\Users\jckod\fvm\versions\3.16.7\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\jckod\fvm\default. Consider adding
      C:\Users\jckod\fvm\default\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ef1af02aea (2 days ago), 2024-01-11 15:19:26 -0600
    • Engine revision 4a585b7929
    • Dart version 3.2.4
    • DevTools version 2.28.5
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\jckod\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34330.188
    • Windows 10 SDK version 10.0.22621.0

[✓] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[✓] VS Code (version 1.85.1)
    • VS Code at C:\Users\jckod\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.80.0

[✓] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.3007]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 120.0.6099.217
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 120.0.2210.91

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

! Doctor found issues in 1 category.

Dart Version

3.2.4

Steps to Reproduce

  1. Use the NativeAdapter() on Dio()..httpClientAdapter = NativeAdapter().

Expected Result

To work without issues

Actual Result

The query is completed, but a native error is thrown:

E/hy      ( 7955): Exception fetching LoggerImpl class
E/hy      ( 7955): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
E/hy      ( 7955): 	at dalvik.system.DelegateLastClassLoader.loadClass(DelegateLastClassLoader.java:199)
E/hy      ( 7955): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/hy      ( 7955): 	at org.chromium.net.impl.CronetUrlRequestContext.<init>(:com.google.android.gms.dynamite_cronetdynamite@234914041@23.49.14 (190800-0):90)
E/hy      ( 7955): 	at org.chromium.net.impl.NativeCronetEngineBuilderImpl.build(:com.google.android.gms.dynamite_cronetdynamite@234914041@23.49.14 (190800-0):14)
E/hy      ( 7955): 	at org.chromium.net.CronetEngine$Builder.build(CronetEngine.java:313)

Removing the NativeAdapter "fixes" the issue.

@JCKodel JCKodel added h: need triage This issue needs to be categorized s: bug Something isn't working labels Jan 13, 2024
@AlexV525
Copy link
Member

Could you help to identify if this is also happening when using the cronet_http alone?

@JCKodel
Copy link
Author

JCKodel commented Jan 14, 2024

I've created a new project and added only dio, native_dio_adapter and cronet-http.

Using Dio, this is the log (notice the last 200 is actually the result query, which was successful):

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Note: C:\Users\jckod\AppData\Local\Pub\Cache\hosted\pub.dev\jni-0.7.2\android\src\main\java\com\github\dart_lang\jni\JniPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

✓  Built build\app\outputs\flutter-apk\app-debug.apk.
W/OpenGLRenderer( 6658): Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
W/OpenGLRenderer( 6658): Failed to initialize 101010-2 format, error = EGL_SUCCESS
I/Gralloc4( 6658): mapper 4.x is not supported
Connecting to VM Service at ws://127.0.0.1:52005/TX9UBB9WNeA=/ws
E/OpenGLRenderer( 6658): Unable to match the desired swap behavior.
W/ziparchive( 6658): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/0000002e/DynamiteLoader.dm': No such file or directory
W/ziparchive( 6658): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/0000002e/DynamiteLoader.dm': No such file or directory
I/DynamiteModule( 6658): Considering local module com.google.android.gms.cronet_dynamite:0 and remote module com.google.android.gms.cronet_dynamite:2611
I/DynamiteModule( 6658): Selected remote version of com.google.android.gms.cronet_dynamite, version >= 2611
V/DynamiteModule( 6658): Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/System  ( 6658): ClassLoader referenced unknown path:
D/nativeloader( 6658): Configuring clns-7 for other apk . target_sdk_version=34, uses_libraries=, library_path=/data/app/~~vLRq4ERImDC_oL4IzP0m5g==/com.google.android.gms-OvWGfV--stjaBafhWQxl6w==/lib/x86_64:/data/app/~~vLRq4ERImDC_oL4IzP0m5g==/com.google.android.gms-OvWGfV--stjaBafhWQxl6w==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/ziparchive( 6658): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/0000002d/CronetDynamite.dm': No such file or directory
W/ziparchive( 6658): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/0000002d/CronetDynamite.dm': No such file or directory
D/nativeloader( 6658): Configuring clns-8 for other apk . target_sdk_version=33, uses_libraries=ALL, library_path=/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, permitted_path=/data:/mnt/expand
I/cr_CronetLibraryLoader( 6658): Cronet version: 119.0.6045.31, arch: x86_64
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@234914041@23.49.14 (190800-0):90)
E/hy      ( 6658): 	at org.chromium.net.impl.NativeCronetEngineBuilderImpl.build(:com.google.android.gms.dynamite_cronetdynamite@234914041@23.49.14 (190800-0):14)
E/hy      ( 6658): 	at org.chromium.net.CronetEngine$Builder.build(CronetEngine.java:313)
I/flutter ( 6658): 200

Now, using cronet_http, same error:

Restarted application in 947ms.
D/EGL_emulation( 6658): app_time_stats: avg=5001.00ms min=5001.00ms max=5001.00ms 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@234914041@23.49.14 (190800-0):90)
E/hy      ( 6658): 	at org.chromium.net.impl.NativeCronetEngineBuilderImpl.build(:com.google.android.gms.dynamite_cronetdynamite@234914041@23.49.14 (190800-0):14)
E/hy      ( 6658): 	at org.chromium.net.CronetEngine$Builder.build(CronetEngine.java:313)

So, I guess is a cronet_http issue =\

@JCKodel
Copy link
Author

JCKodel commented Jan 14, 2024

Opened an issue there: dart-lang/http#1116

@AlexV525
Copy link
Member

Thanks for the clarify.

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
@AlexV525 AlexV525 added i: out of support p: dependency Targeting packages that's used by dio packages and removed h: need triage This issue needs to be categorized s: bug Something isn't working labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i: out of support p: dependency Targeting packages that's used by dio packages
Projects
None yet
Development

No branches or pull requests

2 participants