Reputation: 13
I'm new to Android Studio, and I'm trying to use Mapbox in Android studio following the documentation. Here is the documentation that I followed: https://docs.mapbox.com/android/maps/guides/install/. But as i ran the code, the emulator just collapsed (app "keeps stopping"). Down here is the Logcat
MapboxInitializer I MapboxSDKCommonInitializer create() is called
MapboxInitializer I MapboxInitializer started MapboxSDKCommonInitializerImpl initialization, attempt 1
Mapbox I [common]: Using Mapbox Common SDK v24.2.3(9e05c147b)
MapboxInitializer I Initialized MapboxSDKCommonInitializerImpl successfully
MapboxInitializer I MapboxMapsInitializer create() is called
MapboxInitializer I MapboxInitializer started MapboxMapsInitializerImpl initialization, attempt 1
Mapbox I [maps-core]: Using Mapbox Core Maps SDK v11.2.2(9d3efddb51)
Mapbox I [MapboxReachability]: Application permission for ACCESS_NETWORK_STATE granted
MapboxInitializer I Initialized MapboxMapsInitializerImpl successfully
libEGL D Emulator has host GPU support, qemu.gles is set to 1.
libc W Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
libEGL D loaded /vendor/lib/egl/libEGL_emulation.so
RenderThread W type=1400 audit(0.0:306): avc: denied { write } for name="property_service" dev="tmpfs" ino=7048 scontext=u:r:untrusted_app:s0:c150,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
libEGL D loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
libEGL D loaded /vendor/lib/egl/libGLESv2_emulation.so
AppCompatDelegate D Checking for metadata for AppLocalesMetadataHolderService : Service not found
Mapbox W [config_service]: No configuration options found stored on the disk.
ple.kotlinmaps W Accessing hidden field Landroid/graphics/Typeface;->sSystemFontMap:Ljava/util/Map; (greylist, reflection, allowed)
Mbgl-FontUtils I Couldn't map font family for local ideograph, using sans-serif instead
NetworkSe...tyConfig D No Network Security Config specified, using platform default
Mapbox W [config_service]: Update request 1 in progress (attempt 0 of 2)
Mapbox W [config_service]: Update request 1 in progress (attempt 0 of 2)
Mapbox W [config_service]: Update request 1 in progress (attempt 0 of 2)
Mapbox I [maps-core]: {}[General]: Unable to get stored configuration: Update request 1 in progress (attempt 0 of 2)
Mapbox W [config_service]: Unable to fetch configuration HTTP error: Unable to resolve host "config.mapbox.com": No address associated with hostname(ConnectionError)
Mapbox W [config_service]: No configuration options found stored on the disk.
Mapbox W [config_service]: Unable to fetch configuration HTTP error: Unable to resolve host "config.mapbox.com": No address associated with hostname(ConnectionError)
Mapbox I [maps-android\ThreadChecker]: No boolean metadata found for key com.mapbox.maps.ThreadChecker Attempt to invoke virtual method 'boolean android.os.Bundle.containsKey(java.lang.String)' on a null object reference
Mapbox I [maps-android\ThreadChecker]: Unable to lookup build config of application. com.example.kotlinmapsy.BuildConfig
ple.kotlinmaps W Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
ple.kotlinmaps W Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox I [LifecycleUtils]: Task: TaskInfo{userId=0 stackId=74 taskId=152 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.kotlinmapsy/.MainActivity } baseActivity=ComponentInfo{com.example.kotlinmapsy/com.example.kotlinmapsy.MainActivity} topActivity=ComponentInfo{com.example.kotlinmapsy/com.example.kotlinmapsy.MainActivity} origActivity=null realActivity=ComponentInfo{com.example.kotlinmapsy/com.example.kotlinmapsy.MainActivity} numActivities=1 lastActiveTime=30872417 supportsSplitScreenMultiWindow=true resizeMode=1
Choreographer I Skipped 46 frames! The application may be doing too much work on its main thread.
Mapbox I [maps-android\Mbgl-RenderThread]: Renderer resumed, renderThreadPrepared=false, surface.isValid=null
Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
HostConnection D HostConnection::get() New Host Connection established 0xdad4e040, tid 31876
HostConnection D HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
Mapbox I [maps-android\Mbgl-RenderThread]: onSurfaceCreated
Mapbox I [maps-android\Mbgl-RenderThread]: onSurfaceCreated: waiting Android surface to be processed...
Mapbox I [maps-android\Mbgl-RenderThread]: Setting up render thread, flags: creatingSurface=true, nativeRenderCreated=false, eglContextMadeCurrent=false, eglContextCreated=false, paused=false
OpenGLRenderer W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Mapbox I [maps-android\Mbgl-EGLConfigChooser]: In emulator: true
HostConnection D HostConnection::get() New Host Connection established 0xc2a0e860, tid 31879
eglCodecCommon D setVertexArrayObject: set vao to 0 (0) 0 0
HostConnection D HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
EGL_emulation D eglCreateContext: 0xdad1a840: maj 2 min 0 rcv 2
EGL_emulation E eglCreateContext: EGL_BAD_CONFIG: no ES 3 support
EGL_emulation E tid 31879: eglCreateContext(1570): error 0x3005 (EGL_BAD_CONFIG)
Mapbox E [maps-android\Mbgl-EglCore]: eglCreateContext: EGL error: 0x3005
Mapbox I [maps-android\Mbgl-RenderThread]: onSurfaceCreated: Android surface was processed.
AndroidRuntime E FATAL EXCEPTION: MapboxRenderThread
Process: com.example.kotlinmapsy, PID: 31837
java.lang.IllegalStateException: OpenGL ES 3.0 context could not be created
at com.mapbox.maps.renderer.egl.EGLCore.prepareEgl(EGLCore.kt:89)
at com.mapbox.maps.renderer.MapboxRenderThread.checkEglConfig(MapboxRenderThread.kt:241)
at com.mapbox.maps.renderer.MapboxRenderThread.setUpRenderThread(MapboxRenderThread.kt:202)
at com.mapbox.maps.renderer.MapboxRenderThread.prepareRenderFrame(MapboxRenderThread.kt:451)
at com.mapbox.maps.renderer.MapboxRenderThread.processAndroidSurface$sdk_release(MapboxRenderThread.kt:534)
at com.mapbox.maps.renderer.MapboxRenderThread$onSurfaceCreated$1$1$1.invoke(MapboxRenderThread.kt:551)
at com.mapbox.maps.renderer.MapboxRenderThread$onSurfaceCreated$1$1$1.invoke(MapboxRenderThread.kt:550)
at com.mapbox.maps.renderer.RenderHandlerThread.postDelayed$lambda$1$lambda$0(RenderHandlerThread.kt:39)
at com.mapbox.maps.renderer.RenderHandlerThread.$r8$lambda$YB_YSeUrlxhPn95u2dpCGDwyAyU(Unknown Source:0)
at com.mapbox.maps.renderer.RenderHandlerThread$$ExternalSyntheticLambda0.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:67)
Process I Sending signal. PID: 31837 SIG: 9
InputDispatcher E channel '8134d88 com.example.kotlinmapsy/com.example.kotlinmapsy.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
and this is my MainActivity.java code following the documentation
package com.example.kotlinmapsy
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.mapbox.geojson.Point
import com.mapbox.maps.CameraOptions
import com.mapbox.maps.MapView
class MainActivity : AppCompatActivity() {
private lateinit var mapView: MapView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Create a map programmatically and set the initial camera
mapView = MapView(this)
mapView.mapboxMap.setCamera(
CameraOptions.Builder()
.center(Point.fromLngLat(-98.0, 39.5))
.pitch(0.0)
.zoom(2.0)
.bearing(0.0)
.build()
)
// Add the map view to the activity (you can also add it to other views as a child)
setContentView(mapView)
}
}
Upvotes: 1
Views: 358