Mapbox 示例地图不适用于 Android Studio/Genymotion
Mapbox example map not working with Android Studio/Genymotion
所以我已经使用 Android Studio 和 Mapbox 大约 3 个月了,上周我决定对我的 PC 进行干净格式化。我重新安装了我的驱动程序,更新了 AS 并重新安装了 Genymotion(我用它来模拟)。但是现在我每次尝试编译和 运行 简单 Mapbox 示例时都会遇到错误。
它说我需要为 MapView 分配一个 API 键,但我已经用 MapBoxAccountManager 做了。但是,当我将 API 键分配给 .xml 中的 MapView 时,出现以下错误。
问题是我以前使用过相同的 API 密钥,但从未遇到过这个问题,如果我编译 hello world 项目,它会完美运行。
这里是 logcat:
07-06 09:28:21.797 4780-4780/com.example.brian.mapboxdemo W/art: Failed to find OatDexFile for DexFile /data/data/com.example.brian.mapboxdemo/files/instant-run/dex/slice-slice_9-classes.dex ( canonical path /data/data/com.example.brian.mapboxdemo/files/instant-run/dex/slice-slice_9-classes.dex) with checksum 0x69babcd9 in OatFile /data/data/com.example.brian.mapboxdemo/cache/slice-slice_9-classes.dex
07-06 09:28:22.170 4780-4780/com.example.brian.mapboxdemo I/art: Thread[1,tid=4780,WaitingForJniOnLoad,Thread*=0xf4406800,peer=0x742ef970,"main"] recursive attempt to load library "/data/app/com.example.brian.mapboxdemo-1/lib/x86/libmapbox-gl.so"
07-06 09:28:22.170 4780-4780/com.example.brian.mapboxdemo I/art: Thread[1,tid=4780,WaitingForJniOnLoad,Thread*=0xf4406800,peer=0x742ef970,"main"] recursive attempt to load library "/data/app/com.example.brian.mapboxdemo-1/lib/x86/libmapbox-gl.so"
07-06 09:28:22.210 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Telemetry initialize() called...
07-06 09:28:22.214 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Right before Telemetry set enabled in initialized()
07-06 09:28:22.216 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: setTelemetryEnabled(); this.telemetryEnabled = false; telemetryEnabled = true
07-06 09:28:22.216 4780-4780/com.example.brian.mapboxdemo D/MapboxEventManager: Starting Telemetry Up!
07-06 09:28:22.218 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Permissions are good, see if GPS is enabled and if not then setup Ambient.
07-06 09:28:22.221 4780-4780/com.example.brian.mapboxdemo E/MapboxEventManager: Error Trying to load Staging Credentials: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
07-06 09:28:22.222 4780-4780/com.example.brian.mapboxdemo I/com.mapbox.mapboxsdk.maps.MapView: MapView start Telemetry...
07-06 09:28:22.222 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Telemetry initialize() called...
07-06 09:28:22.222 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Mapbox Telemetry has already been initialized.
07-06 09:28:22.224 4780-4780/com.example.brian.mapboxdemo D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
07-06 09:28:22.224 4780-4780/com.example.brian.mapboxdemo D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
07-06 09:28:22.228 4780-4780/com.example.brian.mapboxdemo D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
[ 07-06 09:28:22.233 4780: 4780 D/ ]
HostConnection::get() New Host Connection established 0xeb7259b0, tid 4780
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Vendor: Android
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Version: 1.4 Android META-EGL
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Client APIs: OpenGL_ES
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Client Extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_image_base EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo W/mbgl: [Android]: In emulator! Enabling hacks :-(
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Found 8 configs
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 0:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 1:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 2:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 3:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 4:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 5:
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 6:
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 7:
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Chosen config is 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Chosen window format is 1
07-06 09:28:22.310 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: flushEventsQueueImmediately() called...
07-06 09:28:22.312 4780-4780/com.example.brian.mapboxdemo D/MapboxEventManager: turnstile event pushed.
07-06 09:28:22.318 4780-4836/com.example.brian.mapboxdemo D/OpenGLRenderer: Render dirty regions requested: true
07-06 09:28:22.323 4780-4780/com.example.brian.mapboxdemo D/Atlas: Validating map...
07-06 09:28:22.330 4780-4780/com.example.brian.mapboxdemo I/TelemetryService: onCreate() called
07-06 09:28:22.331 4780-4780/com.example.brian.mapboxdemo I/TelemetryService: onStartCommand() called
07-06 09:28:22.351 4780-4836/com.example.brian.mapboxdemo I/OpenGLRenderer: Initialized EGL, version 1.4
[ 07-06 09:28:22.351 4780: 4836 D/ ]
HostConnection::get() New Host Connection established 0xe3d0b710, tid 4836
07-06 09:28:22.398 4780-4836/com.example.brian.mapboxdemo D/OpenGLRenderer: Enabling debug mode 0
07-06 09:28:22.446 4780-4836/com.example.brian.mapboxdemo W/EGL_emulation: eglSurfaceAttrib not implemented
07-06 09:28:22.446 4780-4836/com.example.brian.mapboxdemo W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe3d07ea0, error=EGL_SUCCESS
07-06 09:28:22.535 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Vendor: Google (ATI Technologies Inc.)
07-06 09:28:22.546 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Renderer: Android Emulator OpenGL ES Translator (AMD Radeon R9 200 Series)
07-06 09:28:22.548 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Version: OpenGL ES 2.0 (4.5.13440 Compatibility Profile Context 16.200.1013.0)
07-06 09:28:22.548 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Extensions: GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_texture_npot GL_OES_rgb8_rgba8
07-06 09:28:22.919 4780-4780/com.example.brian.mapboxdemo E/mbgl: [Shader]: Shader failed to compile: Vertex shader failed to compile with the following errors:
ERROR: 0:6: error(#101) Macro redefined: lowp
ERROR: 0:7: error(#101) Macro redefined: mediump
ERROR: 0:8: error(#101) Macro redefined: highp
ERROR: error(#273) 3 compilation errors. No code generated
07-06 09:28:22.919 4780-4780/com.example.brian.mapboxdemo E/mbgl: [Shader]: Vertex shader fill failed to compile: precision highp float;
#ifdef GL_ES
precision highp float;
#else
#define lowp
#define mediump
#define highp
#endif
attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * vec4(a_pos, 0, 1);
}
--------- beginning of crash
07-06 09:28:22.920 4780-4780/com.example.brian.mapboxdemo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadcab1 in tid 4780 (rian.mapboxdemo)`
MapboxAccountManager
目前有一个错误会导致您描述的问题,更多信息可以是 found on Github. To get around this for now you can either create an Application java class (example of this can be found in the testapp 或者您可以使用旧方法(现已弃用)通过以下方式设置访问令牌XML。您可以通过在 mapview xml 布局中添加此行来执行此操作:mapbox:access_token="<your access token here>"
.
我还想指出,虽然 Mapbox 应该可以使用模拟器工作,但为了获得最佳体验,建议使用物理设备。
所以我已经使用 Android Studio 和 Mapbox 大约 3 个月了,上周我决定对我的 PC 进行干净格式化。我重新安装了我的驱动程序,更新了 AS 并重新安装了 Genymotion(我用它来模拟)。但是现在我每次尝试编译和 运行 简单 Mapbox 示例时都会遇到错误。
它说我需要为 MapView 分配一个 API 键,但我已经用 MapBoxAccountManager 做了。但是,当我将 API 键分配给 .xml 中的 MapView 时,出现以下错误。
问题是我以前使用过相同的 API 密钥,但从未遇到过这个问题,如果我编译 hello world 项目,它会完美运行。
这里是 logcat:
07-06 09:28:21.797 4780-4780/com.example.brian.mapboxdemo W/art: Failed to find OatDexFile for DexFile /data/data/com.example.brian.mapboxdemo/files/instant-run/dex/slice-slice_9-classes.dex ( canonical path /data/data/com.example.brian.mapboxdemo/files/instant-run/dex/slice-slice_9-classes.dex) with checksum 0x69babcd9 in OatFile /data/data/com.example.brian.mapboxdemo/cache/slice-slice_9-classes.dex
07-06 09:28:22.170 4780-4780/com.example.brian.mapboxdemo I/art: Thread[1,tid=4780,WaitingForJniOnLoad,Thread*=0xf4406800,peer=0x742ef970,"main"] recursive attempt to load library "/data/app/com.example.brian.mapboxdemo-1/lib/x86/libmapbox-gl.so"
07-06 09:28:22.170 4780-4780/com.example.brian.mapboxdemo I/art: Thread[1,tid=4780,WaitingForJniOnLoad,Thread*=0xf4406800,peer=0x742ef970,"main"] recursive attempt to load library "/data/app/com.example.brian.mapboxdemo-1/lib/x86/libmapbox-gl.so"
07-06 09:28:22.210 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Telemetry initialize() called...
07-06 09:28:22.214 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Right before Telemetry set enabled in initialized()
07-06 09:28:22.216 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: setTelemetryEnabled(); this.telemetryEnabled = false; telemetryEnabled = true
07-06 09:28:22.216 4780-4780/com.example.brian.mapboxdemo D/MapboxEventManager: Starting Telemetry Up!
07-06 09:28:22.218 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Permissions are good, see if GPS is enabled and if not then setup Ambient.
07-06 09:28:22.221 4780-4780/com.example.brian.mapboxdemo E/MapboxEventManager: Error Trying to load Staging Credentials: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
07-06 09:28:22.222 4780-4780/com.example.brian.mapboxdemo I/com.mapbox.mapboxsdk.maps.MapView: MapView start Telemetry...
07-06 09:28:22.222 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Telemetry initialize() called...
07-06 09:28:22.222 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: Mapbox Telemetry has already been initialized.
07-06 09:28:22.224 4780-4780/com.example.brian.mapboxdemo D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
07-06 09:28:22.224 4780-4780/com.example.brian.mapboxdemo D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
07-06 09:28:22.228 4780-4780/com.example.brian.mapboxdemo D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
[ 07-06 09:28:22.233 4780: 4780 D/ ]
HostConnection::get() New Host Connection established 0xeb7259b0, tid 4780
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Vendor: Android
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Version: 1.4 Android META-EGL
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Client APIs: OpenGL_ES
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: EGL Client Extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_image_base EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
07-06 09:28:22.286 4780-4780/com.example.brian.mapboxdemo W/mbgl: [Android]: In emulator! Enabling hacks :-(
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Found 8 configs
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 0:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 1:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 2:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 3:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 24
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 4:
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.288 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 5:
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 6:
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Config 7:
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Caveat: 12344
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Conformant: 5
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Color: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Red: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Green: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Blue: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Alpha mask: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Depth: 32
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Stencil: 8
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Sample buffers: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: ...Samples: 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Chosen config is 0
07-06 09:28:22.289 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: Chosen window format is 1
07-06 09:28:22.310 4780-4780/com.example.brian.mapboxdemo I/MapboxEventManager: flushEventsQueueImmediately() called...
07-06 09:28:22.312 4780-4780/com.example.brian.mapboxdemo D/MapboxEventManager: turnstile event pushed.
07-06 09:28:22.318 4780-4836/com.example.brian.mapboxdemo D/OpenGLRenderer: Render dirty regions requested: true
07-06 09:28:22.323 4780-4780/com.example.brian.mapboxdemo D/Atlas: Validating map...
07-06 09:28:22.330 4780-4780/com.example.brian.mapboxdemo I/TelemetryService: onCreate() called
07-06 09:28:22.331 4780-4780/com.example.brian.mapboxdemo I/TelemetryService: onStartCommand() called
07-06 09:28:22.351 4780-4836/com.example.brian.mapboxdemo I/OpenGLRenderer: Initialized EGL, version 1.4
[ 07-06 09:28:22.351 4780: 4836 D/ ]
HostConnection::get() New Host Connection established 0xe3d0b710, tid 4836
07-06 09:28:22.398 4780-4836/com.example.brian.mapboxdemo D/OpenGLRenderer: Enabling debug mode 0
07-06 09:28:22.446 4780-4836/com.example.brian.mapboxdemo W/EGL_emulation: eglSurfaceAttrib not implemented
07-06 09:28:22.446 4780-4836/com.example.brian.mapboxdemo W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe3d07ea0, error=EGL_SUCCESS
07-06 09:28:22.535 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Vendor: Google (ATI Technologies Inc.)
07-06 09:28:22.546 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Renderer: Android Emulator OpenGL ES Translator (AMD Radeon R9 200 Series)
07-06 09:28:22.548 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Version: OpenGL ES 2.0 (4.5.13440 Compatibility Profile Context 16.200.1013.0)
07-06 09:28:22.548 4780-4780/com.example.brian.mapboxdemo I/mbgl: [OpenGL]: GL Extensions: GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_texture_npot GL_OES_rgb8_rgba8
07-06 09:28:22.919 4780-4780/com.example.brian.mapboxdemo E/mbgl: [Shader]: Shader failed to compile: Vertex shader failed to compile with the following errors:
ERROR: 0:6: error(#101) Macro redefined: lowp
ERROR: 0:7: error(#101) Macro redefined: mediump
ERROR: 0:8: error(#101) Macro redefined: highp
ERROR: error(#273) 3 compilation errors. No code generated
07-06 09:28:22.919 4780-4780/com.example.brian.mapboxdemo E/mbgl: [Shader]: Vertex shader fill failed to compile: precision highp float;
#ifdef GL_ES
precision highp float;
#else
#define lowp
#define mediump
#define highp
#endif
attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * vec4(a_pos, 0, 1);
}
--------- beginning of crash
07-06 09:28:22.920 4780-4780/com.example.brian.mapboxdemo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadcab1 in tid 4780 (rian.mapboxdemo)`
MapboxAccountManager
目前有一个错误会导致您描述的问题,更多信息可以是 found on Github. To get around this for now you can either create an Application java class (example of this can be found in the testapp 或者您可以使用旧方法(现已弃用)通过以下方式设置访问令牌XML。您可以通过在 mapview xml 布局中添加此行来执行此操作:mapbox:access_token="<your access token here>"
.
我还想指出,虽然 Mapbox 应该可以使用模拟器工作,但为了获得最佳体验,建议使用物理设备。