使用 flutter 构建时,Flutter 终端/控制台充满“greyList API”异常

Lak*_*tta 5 logcat dart flutter

我正在 flutter 中开发,我的 logcat 总是充满这些日志

W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
I/ample.wmbsende( 6845): Background concurrent copying GC freed 126466(5699KB) AllocSpace objects, 6(184KB) LOS objects, 49% free, 7638KB/14MB, paused 476us total 240.336ms
W/ample.wmbsende( 6845): Reducing the number of considered missed Gc histogram windows from 135 to 100
W/System  ( 6845): A resource failed to call release. 
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
I/flutter ( 6845): Instance of 'QuerySnapshot'
D/HostConnection( 6845): HostConnection::get() New Host Connection established 0xf163ba70, tid 7580
D/EGL_emulation( 6845): eglMakeCurrent: 0xf1420a00: ver 2 0 (tinfo 0xf176df30)
D/HostConnection( 6845): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2 
D/EGL_emulation( 6845): eglCreateContext: 0xc1a46600: maj 1 min 0 rcv 1
D/EGL_emulation( 6845): eglMakeCurrent: 0xc1a46600: ver 1 0 (tinfo 0xbd76b5d0)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
Run Code Online (Sandbox Code Playgroud)

它谈论的是一些“灰名单”API,我读过它,我从文档中最多可以看出灰名单 API 是安全问题。

话虽如此,我确实希望摆脱这些异常,但我无力更改任何 API。

我怀疑有问题的库是:

flutter_google_maps:^3.8.0

每次运行此特定代码时,logcat 都会充满垃圾异常。

W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
I/ample.wmbsende( 6845): Background concurrent copying GC freed 126466(5699KB) AllocSpace objects, 6(184KB) LOS objects, 49% free, 7638KB/14MB, paused 476us total 240.336ms
W/ample.wmbsende( 6845): Reducing the number of considered missed Gc histogram windows from 135 to 100
W/System  ( 6845): A resource failed to call release. 
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
I/flutter ( 6845): Instance of 'QuerySnapshot'
D/HostConnection( 6845): HostConnection::get() New Host Connection established 0xf163ba70, tid 7580
D/EGL_emulation( 6845): eglMakeCurrent: 0xf1420a00: ver 2 0 (tinfo 0xf176df30)
D/HostConnection( 6845): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2 
D/EGL_emulation( 6845): eglCreateContext: 0xc1a46600: maj 1 min 0 rcv 1
D/EGL_emulation( 6845): eglMakeCurrent: 0xc1a46600: ver 1 0 (tinfo 0xbd76b5d0)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
Run Code Online (Sandbox Code Playgroud)

logcat 使得我很难看到我试图打印的一些重要信息。我只是想抑制这些例外。

谢谢你的时间。

Pat*_*ick 0

如果使用 IntelliJ Console,您可以通过右键单击 + 像这样折叠线来“折叠”这些无用的线。

如果使用终端,您可以将输出传送到 grep 命令。