首页 > 解决方案 > 颤动的地图框不会在 9 android 上加载样式 json

问题描述

我在 9 android 上显示 mapbox 有问题,颤抖。我加载了 style.json,但地图是空的,没有别的。在 android < 9 版本上它工作正常.. 但 9 idk。我解决了 9 android 上的 http 问题,但它什么也没有。我可以做什么??

有日志:

E/MapboxMapBuilder(15377): setCameraTargetBounds is supported only after map initiated. W/CrashReporter(15377): Root directory doesn't exist W/ba.so.coba_pro(15377): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection) W/ba.so.coba_pro(15377): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection) W/ba.so.coba_pro(15377): Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection) W/ba.so.coba_pro(15377): Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (light greylist, reflection) V/Mbgl-ConnectivityReceiver(15377): connected - true W/ba.so.coba_pro(15377): Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection) D/EGL_emulation(15377): eglMakeCurrent: 0xec29ce00: ver 2 0 (tinfo 0xebe58ad0) I/Mbgl-EGLConfigChooser(15377): In emulator: true D/HostConnection(15377): HostConnection::get() New Host Connection established 0xec230510, tid 15518 D/HostConnection(15377): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 0 (0) 0 0 D/EGL_emulation(15377): eglCreateContext: 0xec205300: maj 2 min 0 rcv 2 W/LocationUpdateReceiver(15377): LocationEngineResult == null D/EGL_emulation(15377): eglMakeCurrent: 0xec205300: ver 2 0 (tinfo 0xec2036b0) I/Mbgl (15377): {Thread-2}[General]: GPU Identifier: Android Emulator OpenGL ES Translator (GeForce MX150/PCIe/SSE2) D/eglCodecCommon(15377): setVertexArrayObject: set vao to 0 (0) 3 0 W/ba.so.coba_pro(15377): Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection) D/HostConnection(15377): HostConnection::get() New Host Connection established 0xebe21530, tid 15414 D/HostConnection(15377): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2 I/ba.so.coba_pro(15377): Background concurrent copying GC freed 23457(1313KB) AllocSpace objects, 2(40KB) LOS objects, 50% free, 1993KB/3MB, paused 7.542ms total 204.932ms D/HostConnection(15377): HostConnection::get() New Host Connection established 0xec230290, tid 15409 D/HostConnection(15377): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 1 (1) 3 0 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 0 (0) 1 5 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 1 (1) 1 4 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 0 (0) 1 5 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 1 (1) 1 4 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 2 (2) 1 0 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 3 (3) 1 0 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 4 (4) 1 0 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 5 (5) 1 0 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 0 (0) 1 5 D/Mbgl-HttpRequest(15377): [HTTP] Cancel request http://SOME IP/geoserver/gwc/service/tms/1.0.0/osm:mrsk@EPSG:900913@pbf/0/0/0.pbf D/Mbgl-HttpRequest(15377): [HTTP] Cancel request http://SOME IP/geoserver/gwc/service/tms/1.0.0/osm:mrsk@EPSG:900913@pbf/4/9/11.pbf D/eglCodecCommon(15377): setVertexArrayObject: set vao to 1 (1) 1 4 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 2 (2) 1 4 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 3 (3) 1 4 D/eglCodecCommon(15377): setVertexArrayObject: set vao to 0 (0) 1 5 I/Mbgl-HttpRequest(15377): Request failed due to a connection error: Socket closed

标签: androidflutterstylesmapbox

解决方案


崩溃日志的第一行似乎是由于 Android 实现中的错误导致调用 setCameraTargetBounds 总是导致该错误并且没有采取任何措施。

请参阅以下内容:https ://github.com/tobrun/flutter-mapbox-gl/blob/master/android/src/main/java/com/mapbox/mapboxgl/MapboxMapBuilder.java

在第 54 行。


推荐阅读