mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
472 stars 131 forks source link

Need help to debug and fix those errors [Compose] #2345

Open petrospap opened 6 months ago

petrospap commented 6 months ago

Hello, first of all, i need to say that I am totally new to android/kotlin/Mapbox after lot of reading/searching, i have made an app using Mapbox Compose with bottom NavigationBar buttons in NavigationBar [Info - Map]

Is patrial working and I am facing some crashes the point is that I don't know if is my code (although I know it has some issues) or is MapBox issue or Android emulator

[MapScreen]

package com.aopharm.openpharmacies.ui.screens

import android.content.Context
import android.graphics.Bitmap
import android.widget.Toast
//import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
//import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
//import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
//import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.toBitmap
import com.aopharm.openpharmacies.R
import com.aopharm.openpharmacies.model.PharmaciesData
import com.mapbox.geojson.Point
// Map V 11.2.2
//import com.mapbox.maps.CameraOptions
//import com.mapbox.maps.MapInitOptions
import com.mapbox.maps.MapboxExperimental
//import com.mapbox.maps.Style
import com.mapbox.maps.extension.compose.MapboxMap
import com.mapbox.maps.extension.compose.annotation.generated.PointAnnotation

// Map 11.3.0
import com.mapbox.maps.extension.compose.animation.viewport.MapViewportState
//import com.mapbox.maps.extension.compose.style.MapStyle

private const val LATITUDE = 37.9840
private const val LONGITUDE = 23.7280
@Composable
fun MapScreen(
    pharmaciesUiState: PharmaciesUiState,
    retryAction: () -> Unit,
    modifier: Modifier = Modifier,
) {
    when (pharmaciesUiState) {
        is PharmaciesUiState.Loading -> LoadingScreen(modifier = modifier.fillMaxSize())
        is PharmaciesUiState.Success -> {
            StartMap(
                pharmaciesUiState.photos,
                modifier = modifier.fillMaxWidth()
            )
        }
        is PharmaciesUiState.Error -> ErrorScreen(retryAction, modifier = modifier.fillMaxSize())
    }
}

@OptIn(MapboxExperimental::class)
@Composable
fun StartMap(
    photos: List<PharmaciesData>,
    modifier:  Modifier,
    context: Context = LocalContext.current
) {

    //val drawable = remember(context) {
    //    ContextCompat.getDrawable(context, R.drawable.red_marker)
    //}
    val drawable = context.getDrawable(R.drawable.red_marker)//.red_marker blue_marker
    val bitmap = drawable!!.toBitmap(
        drawable.intrinsicWidth,
        drawable.intrinsicHeight,
        Bitmap.Config.ARGB_8888
    )

    Box(
        contentAlignment = Alignment.Center,
        modifier = Modifier
            //.background(MaterialTheme.colorScheme.primaryContainer)
            //.fillMaxSize()
    ) {

        // V 11.3.0
        MapboxMap(
            Modifier.fillMaxSize(),
            mapViewportState = MapViewportState().apply {
                setCameraOptions {
                    zoom(2.0)
                    center(Point.fromLngLat(LONGITUDE, LATITUDE)) // -98.0, 39.5
                    pitch(0.0)
                    bearing(0.0)
                }
            }
        )

        // V 11.2.2
        /*
        MapboxMap(
            modifier = Modifier.fillMaxSize(),
            //mapViewportState = mapViewportState,
            mapInitOptionsFactory = { context ->
                MapInitOptions(
                    context = context,
                    //styleUri = Style.MAPBOX_STREETS, // TRAFFIC_DAY,
                    cameraOptions = CameraOptions.Builder()
                        .center(Point.fromLngLat(LONGITUDE, LATITUDE))
                        .zoom(2.0)
                        .pitch(0.0)
                        .bearing(0.0)
                        .build()
                )
            }
        )
        */
        {
            for (e in photos) {
                PointAnnotation(
                    iconImageBitmap = bitmap,
                    iconSize = 0.5,
                    point = Point.fromLngLat(e.lon, e.lat),//LONGITUDE, LATITUDE
                    onClick = {
                        Toast.makeText(
                            context,
                            "Pharmacy: $e.name",
                            Toast.LENGTH_LONG //LENGTH_SHORT
                        ).show()
                        true
                    }
                )
            }
        }
    }
}

Running in Android Studio Iguana | 2023.2.1 Patch 2 MapBox version 11.3.0 emulators - Tiramisu Medium Phone Api 33 - UpsideDownCake API 34

implementation("com.mapbox.extension:maps-compose:11.3.0")
implementation("com.mapbox.maps:android:11.3.0")

[Logs] when start App, first page [Info]

--------- beginning of main
--------- beginning of system
2024-04-15 11:22:41.530  3703-3703  ziparchive              com.aopharm.openpharmacies           W  Unable to open '/data/data/com.aopharm.openpharmacies/code_cache/.overlay/base.apk/classes5.dm': No such file or directory
2024-04-15 11:22:41.557  3703-3703  ziparchive              com.aopharm.openpharmacies           W  Unable to open '/data/app/~~bCTEtIpWiGGDCeL7M0e5hA==/com.aopharm.openpharmacies-62zGEEOIKR64lTQmzb6TQw==/base.dm': No such file or directory
2024-04-15 11:22:41.557  3703-3703  ziparchive              com.aopharm.openpharmacies           W  Unable to open '/data/app/~~bCTEtIpWiGGDCeL7M0e5hA==/com.aopharm.openpharmacies-62zGEEOIKR64lTQmzb6TQw==/base.dm': No such file or directory
2024-04-15 11:22:42.101  3703-3703  nativeloader            com.aopharm.openpharmacies           D  Configuring classloader-namespace for other apk /data/app/~~bCTEtIpWiGGDCeL7M0e5hA==/com.aopharm.openpharmacies-62zGEEOIKR64lTQmzb6TQw==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~bCTEtIpWiGGDCeL7M0e5hA==/com.aopharm.openpharmacies-62zGEEOIKR64lTQmzb6TQw==/lib/x86_64:/data/app/~~bCTEtIpWiGGDCeL7M0e5hA==/com.aopharm.openpharmacies-62zGEEOIKR64lTQmzb6TQw==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.aopharm.openpharmacies
2024-04-15 11:22:42.122  3703-3703  GraphicsEnvironment     com.aopharm.openpharmacies           V  ANGLE Developer option for 'com.aopharm.openpharmacies' set to: 'default'
2024-04-15 11:22:42.125  3703-3703  GraphicsEnvironment     com.aopharm.openpharmacies           V  ANGLE GameManagerService for com.aopharm.openpharmacies: false
2024-04-15 11:22:42.126  3703-3703  GraphicsEnvironment     com.aopharm.openpharmacies           V  Neither updatable production driver nor prerelease driver is supported.
2024-04-15 11:22:42.136  3703-3703  NetworkSecurityConfig   com.aopharm.openpharmacies           D  No Network Security Config specified, using platform default
2024-04-15 11:22:42.136  3703-3703  NetworkSecurityConfig   com.aopharm.openpharmacies           D  No Network Security Config specified, using platform default
2024-04-15 11:22:42.155  3703-3703  MapboxInitializer       com.aopharm.openpharmacies           I  MapboxSDKCommonInitializer create() is called
2024-04-15 11:22:42.164  3703-3703  MapboxInitializer       com.aopharm.openpharmacies           I  MapboxInitializer started MapboxSDKCommonInitializerImpl initialization, attempt 1
2024-04-15 11:22:42.343  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [common]: Using Mapbox Common SDK v24.3.1(0b57c207b)
2024-04-15 11:22:42.529  3703-3703  MapboxInitializer       com.aopharm.openpharmacies           I  Initialized MapboxSDKCommonInitializerImpl successfully
2024-04-15 11:22:42.529  3703-3703  MapboxInitializer       com.aopharm.openpharmacies           I  MapboxMapsInitializer create() is called
2024-04-15 11:22:42.530  3703-3703  MapboxInitializer       com.aopharm.openpharmacies           I  MapboxInitializer started MapboxMapsInitializerImpl initialization, attempt 1
2024-04-15 11:22:42.555  3703-3725  Mapbox                  com.aopharm.openpharmacies           I  [MapboxReachability]: Application permission for ACCESS_NETWORK_STATE granted
2024-04-15 11:22:42.574  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-core]: Using Mapbox Core Maps SDK v11.3.0(36ab08e5ed)
2024-04-15 11:22:42.694  3703-3703  MapboxInitializer       com.aopharm.openpharmacies           I  Initialized MapboxMapsInitializerImpl successfully
2024-04-15 11:22:42.740  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V (unsupported, reflection, allowed)
2024-04-15 11:22:42.857  3703-3732  libEGL                  com.aopharm.openpharmacies           D  loaded /vendor/lib64/egl/libEGL_emulation.so
2024-04-15 11:22:42.859  3703-3732  libEGL                  com.aopharm.openpharmacies           D  loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2024-04-15 11:22:42.863  3703-3732  libEGL                  com.aopharm.openpharmacies           D  loaded /vendor/lib64/egl/libGLESv2_emulation.so
2024-04-15 11:22:43.068  3703-3733  Mapbox                  com.aopharm.openpharmacies           I  [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=63 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.aopharm.openpharmacies/.MainActivity } baseActivity=ComponentInfo{com.aopharm.openpharmacies/com.aopharm.openpharmacies.MainActivity} topActivity=ComponentInfo{com.aopharm.openpharmacies/com.aopharm.openpharmacies.MainActivity} origActivity=null realActivity=ComponentInfo{com.aopharm.openpharmacies/com.aopharm.openpharmacies.MainActivity} numActivities=1 lastActiveTime=33573260 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@123ac4e} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 displayCutoutSafeInsets=null topActivityInfo=ActivityInfo{d04516f com.aopharm.openpharmacies.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}
2024-04-15 11:22:44.376  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Method boolean androidx.compose.runtime.snapshots.SnapshotStateList.conditionalUpdate(boolean, kotlin.jvm.functions.Function1) failed lock verification and will run slower.
                                                                                                    Common causes for lock verification issues are non-optimized dex code
                                                                                                    and incorrect proguard optimizations.
2024-04-15 11:22:44.376  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Method boolean androidx.compose.runtime.snapshots.SnapshotStateList.conditionalUpdate$default(androidx.compose.runtime.snapshots.SnapshotStateList, boolean, kotlin.jvm.functions.Function1, int, java.lang.Object) failed lock verification and will run slower.
2024-04-15 11:22:44.376  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateList.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2024-04-15 11:22:44.377  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Method void androidx.compose.runtime.snapshots.SnapshotStateList.update(boolean, kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2024-04-15 11:22:44.378  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Method void androidx.compose.runtime.snapshots.SnapshotStateList.update$default(androidx.compose.runtime.snapshots.SnapshotStateList, boolean, kotlin.jvm.functions.Function1, int, java.lang.Object) failed lock verification and will run slower.
2024-04-15 11:22:44.456  3703-3730  HostConnection          com.aopharm.openpharmacies           D  createUnique: call
2024-04-15 11:22:44.456  3703-3730  HostConnection          com.aopharm.openpharmacies           D  HostConnection::get() New Host Connection established 0x7b7672ec7050, tid 3730
2024-04-15 11:22:44.465  3703-3730  HostConnection          com.aopharm.openpharmacies           D  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_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2024-04-15 11:22:44.469  3703-3730  OpenGLRenderer          com.aopharm.openpharmacies           W  Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2024-04-15 11:22:44.471  3703-3730  OpenGLRenderer          com.aopharm.openpharmacies           W  Failed to initialize 101010-2 format, error = EGL_SUCCESS
2024-04-15 11:22:44.505  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  eglCreateContext: 0x7b7672ec7c50: maj 3 min 0 rcv 3
2024-04-15 11:22:44.510  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  eglMakeCurrent: 0x7b7672ec7c50: ver 3 0 (tinfo 0x7b7897000080) (first time)
2024-04-15 11:22:44.531  3703-3734  TrafficStats            com.aopharm.openpharmacies           D  tagSocket(88) with statsTag=0xffffffff, statsUid=-1
2024-04-15 11:22:44.598  3703-3730  Gralloc4                com.aopharm.openpharmacies           I  mapper 4.x is not supported
2024-04-15 11:22:44.602  3703-3730  HostConnection          com.aopharm.openpharmacies           D  createUnique: call
2024-04-15 11:22:44.602  3703-3730  HostConnection          com.aopharm.openpharmacies           D  HostConnection::get() New Host Connection established 0x7b7672ec9210, tid 3730
2024-04-15 11:22:44.602  3703-3730  goldfish-address-space  com.aopharm.openpharmacies           D  allocate: Ask for block of size 0x100
2024-04-15 11:22:44.602  3703-3730  goldfish-address-space  com.aopharm.openpharmacies           D  allocate: ioctl allocate returned offset 0x3efffe000 size 0x2000
2024-04-15 11:22:44.698  3703-3730  Gralloc4                com.aopharm.openpharmacies           W  allocator 4.x is not supported
2024-04-15 11:22:44.725  3703-3730  HostConnection          com.aopharm.openpharmacies           D  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_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2024-04-15 11:22:45.075  3703-3721  OpenGLRenderer          com.aopharm.openpharmacies           I  Davey! duration=2327ms; Flags=1, FrameTimelineVsyncId=1107585, IntendedVsync=33574840972976, Vsync=33575157639630, InputEventId=0, HandleInputStart=33575171648200, AnimationStart=33575171677900, PerformTraversalsStart=33575173125800, DrawStart=33576831273300, FrameDeadline=33574857639642, FrameInterval=33575171606300, FrameStartTime=16666666, SyncQueued=33577103050800, SyncStart=33577104835400, IssueDrawCommandsStart=33577106655100, SwapBuffers=33577162911700, FrameCompleted=33577170504500, DequeueBufferDuration=35400, QueueBufferDuration=1070300, GpuCompleted=33577170337800, SwapBuffersCompleted=33577170504500, DisplayPresentTime=13597866462301, CommandSubmissionCompleted=33577162911700, 
2024-04-15 11:22:45.078  3703-3730  Parcel                  com.aopharm.openpharmacies           W  Expecting binder but got null!
2024-04-15 11:22:45.101  3703-3733  Mapbox                  com.aopharm.openpharmacies           I  [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=63 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.aopharm.openpharmacies/.MainActivity } baseActivity=ComponentInfo{com.aopharm.openpharmacies/com.aopharm.openpharmacies.MainActivity} topActivity=ComponentInfo{com.aopharm.openpharmacies/com.aopharm.openpharmacies.MainActivity} origActivity=null realActivity=ComponentInfo{com.aopharm.openpharmacies/com.aopharm.openpharmacies.MainActivity} numActivities=1 lastActiveTime=33573260 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@2a1d895} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 displayCutoutSafeInsets=null topActivityInfo=ActivityInfo{724cdaa com.aopharm.openpharmacies.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}
2024-04-15 11:22:45.124  3703-3703  Choreographer           com.aopharm.openpharmacies           I  Skipped 113 frames!  The application may be doing too much work on its main thread.
2024-04-15 11:22:45.211  3703-3721  OpenGLRenderer          com.aopharm.openpharmacies           I  Davey! duration=1967ms; Flags=0, FrameTimelineVsyncId=1107641, IntendedVsync=33575340972956, Vsync=33577224306214, InputEventId=0, HandleInputStart=33577227355900, AnimationStart=33577227388900, PerformTraversalsStart=33577289676900, DrawStart=33577290117300, FrameDeadline=33577190972882, FrameInterval=33577226993100, FrameStartTime=16666666, SyncQueued=33577292185600, SyncStart=33577292543700, IssueDrawCommandsStart=33577292743300, SwapBuffers=33577293874000, FrameCompleted=33577308753500, DequeueBufferDuration=56400, QueueBufferDuration=1129100, GpuCompleted=33577308753500, SwapBuffersCompleted=33577297344300, DisplayPresentTime=14723147894111, CommandSubmissionCompleted=33577293874000, 
2024-04-15 11:22:45.506  3703-3703  Compatibil...geReporter com.aopharm.openpharmacies           D  Compat change id reported: 171228096; UID 10159; state: ENABLED
2024-04-15 11:22:47.048  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=246.75ms min=4.08ms max=1172.36ms count=8
2024-04-15 11:22:47.693  3703-3713  .openpharmacies         com.aopharm.openpharmacies           I  Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()
2024-04-15 11:22:48.062  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=16.52ms min=12.74ms max=19.89ms count=61
2024-04-15 11:22:48.750  3703-3750  ProfileInstaller        com.aopharm.openpharmacies           D  Installing profile for com.aopharm.openpharmacies
2024-04-15 11:22:49.065  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=12.27ms min=4.37ms max=48.55ms count=56
2024-04-15 11:22:50.079  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=4.46ms min=3.73ms max=6.76ms count=61
2024-04-15 11:22:51.079  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=4.72ms min=3.53ms max=8.55ms count=60
2024-04-15 11:22:51.238  3703-3716  System                  com.aopharm.openpharmacies           W  A resource failed to call close. 
2024-04-15 11:22:52.095  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=4.42ms min=3.64ms max=6.72ms count=61

2 Click On Bottom navigation Map to open/view Map Note: data for markers lom/lat taken from retrofit and is plain json - not GeoJSON and loaded in first page (Approximately 80-100 markers)

(Sometimes shows only black screen with the following errors) emuglGLESv2_enc E device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGetAttribLocation:6280 GL error 0x502 emuglGLESv2_enc E device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGetAttribLocation:6280 GL error 0x502

[Logs]

2024-04-15 11:23:41.351  3703-3703  Mapbox                  com.aopharm.openpharmacies           W  [maps-android\MapViewportState]: tryInvokingOperation invoked when Map is not set, added the operation as pending operation.
2024-04-15 11:23:41.363  3703-3703  .openpharmacies         com.aopharm.openpharmacies           W  Accessing hidden field Landroid/graphics/Typeface;->sSystemFontMap:Ljava/util/Map; (unsupported, reflection, allowed)
2024-04-15 11:23:41.363  3703-3703  Mbgl-FontUtils          com.aopharm.openpharmacies           I  Couldn't map font family for local ideograph, using sans-serif instead
2024-04-15 11:23:41.501  3703-3703  Mapbox                  com.aopharm.openpharmacies           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
2024-04-15 11:23:41.501  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\ThreadChecker]: Unable to lookup build config of application. com.aopharm.openpharmacies.BuildConfig
2024-04-15 11:23:41.641  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Renderer resumed, renderThreadPrepared=false, surface.isValid=null
2024-04-15 11:23:41.641  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
2024-04-15 11:23:41.642  3703-3703  Compatibil...geReporter com.aopharm.openpharmacies           D  Compat change id reported: 193247900; UID 10159; state: ENABLED
2024-04-15 11:23:41.660  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
2024-04-15 11:23:41.667  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: onSurfaceCreated
2024-04-15 11:23:41.667  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: onSurfaceCreated: waiting Android surface to be processed...
2024-04-15 11:23:41.667  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Setting up render thread, flags: creatingSurface=true, nativeRenderCreated=false, eglContextMadeCurrent=false, eglContextCreated=false, paused=false
2024-04-15 11:23:41.671  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-EGLConfigChooser]: In emulator: false
2024-04-15 11:23:41.671  3703-3759  HostConnection          com.aopharm.openpharmacies           D  createUnique: call
2024-04-15 11:23:41.671  3703-3759  HostConnection          com.aopharm.openpharmacies           D  HostConnection::get() New Host Connection established 0x7b7672eced90, tid 3759
2024-04-15 11:23:41.685  3703-3759  HostConnection          com.aopharm.openpharmacies           D  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_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2024-04-15 11:23:41.719  3703-3759  EGL_emulation           com.aopharm.openpharmacies           D  eglCreateContext: 0x7b7672ed0650: maj 3 min 0 rcv 3
2024-04-15 11:23:41.720  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-EglCore]: EGLContext created, client version 3
2024-04-15 11:23:41.727  3703-3759  EGL_emulation           com.aopharm.openpharmacies           D  eglMakeCurrent: 0x7b7672ed0650: ver 3 0 (tinfo 0x7b7897000100) (first time)
2024-04-15 11:23:41.730  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-core]: Using OpenGL render backend
2024-04-15 11:23:41.737  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Native renderer created.
2024-04-15 11:23:41.737  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: onSurfaceCreated: Android surface was processed.
2024-04-15 11:23:41.803  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=242.26ms min=4.00ms max=3327.64ms count=14
2024-04-15 11:23:41.862  3703-3759  emuglGLESv2_enc         com.aopharm.openpharmacies           E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGetStringi:4789 GL error 0x501
2024-04-15 11:23:42.552  3703-3703  MapStyleNode            com.aopharm.openpharmacies           D  Projection(value=) projection  applied
2024-04-15 11:23:42.570  3703-3703  Choreographer           com.aopharm.openpharmacies           I  Skipped 58 frames!  The application may be doing too much work on its main thread.
2024-04-15 11:23:42.604  3703-3703  Mapbox                  com.aopharm.openpharmacies           W  [maps-android\MapViewportState]: tryInvokingOperation invoked when Map is not set, added the operation as pending operation.
2024-04-15 11:23:42.605  3703-3703  Mbgl-FontUtils          com.aopharm.openpharmacies           I  Couldn't map font family for local ideograph, using sans-serif instead
2024-04-15 11:23:42.831  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=13.41ms min=3.64ms max=22.68ms count=61
2024-04-15 11:23:42.877  3703-3759  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=275.46ms min=101.24ms max=618.33ms count=4
2024-04-15 11:23:43.265  3703-3703  Mapbox                  com.aopharm.openpharmacies           W  [maps-android\MapViewportState]: tryInvokingOperation invoked when Map is not set, added the operation as pending operation.
2024-04-15 11:23:43.266  3703-3703  Mbgl-FontUtils          com.aopharm.openpharmacies           I  Couldn't map font family for local ideograph, using sans-serif instead
2024-04-15 11:23:43.410  3703-3703  Mapbox                  com.aopharm.openpharmacies           W  [maps-android\MapViewportState]: tryInvokingOperation invoked when Map is not set, added the operation as pending operation.
2024-04-15 11:23:43.410  3703-3703  Mbgl-FontUtils          com.aopharm.openpharmacies           I  Couldn't map font family for local ideograph, using sans-serif instead
2024-04-15 11:23:43.907  3703-3759  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=205.85ms min=131.86ms max=267.47ms count=5
2024-04-15 11:23:45.019  3703-3759  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=370.71ms min=258.57ms max=554.17ms count=3
2024-04-15 11:23:46.434  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Searching for stray files to clean up
2024-04-15 11:23:46.436  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Cleanup of stray partial downloads complete
2024-04-15 11:23:46.436  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Searching for stale partial downloads to clean up
2024-04-15 11:23:46.438  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Cleanup of stray partial downloads complete
2024-04-15 11:23:46.830  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Searching for stray files to clean up
2024-04-15 11:23:46.833  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Cleanup of stray partial downloads complete
2024-04-15 11:23:46.835  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Searching for stale partial downloads to clean up
2024-04-15 11:23:46.835  3703-3727  Mapbox                  com.aopharm.openpharmacies           I  [tile_store]: Cleanup of stray partial downloads complete
2024-04-15 11:23:47.977  3703-3771  TrafficStats            com.aopharm.openpharmacies           D  tagSocket(60) with statsTag=0xffffffff, statsUid=-1

3 click back on Info Due that cannot find any example how to add properly PointAnnotation in compose i dont know how to solve those error

main issue Can't delete annotation: com.mapbox.maps.plugin.annotation.generated.PointAnnotation@aafea1f, the annotation isn't an active annotation

[Logs]

2024-04-15 11:24:41.180  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=1318.23ms min=2.45ms max=57361.27ms count=44
2024-04-15 11:24:41.234  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Renderer paused
2024-04-15 11:24:41.236  3703-3724  Mapbox                  com.aopharm.openpharmacies           I  [events_service]: Queue is empty, nothing to flush
2024-04-15 11:24:41.268  3703-3703  Mapbox                  com.aopharm.openpharmacies           W  [maps-android\MapViewportState]: tryInvokingOperation invoked when Map is not set, added the operation as pending operation.
2024-04-15 11:24:41.269  3703-3703  Mbgl-FontUtils          com.aopharm.openpharmacies           I  Couldn't map font family for local ideograph, using sans-serif instead
2024-04-15 11:24:41.505  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.538  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.539  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.539  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.539  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.563  3703-3703  Mapbox                  com.aopharm.openpharmacies           W  [maps-android\MapViewportState]: tryInvokingOperation invoked when Map is not set, added the operation as pending operation.
2024-04-15 11:24:41.563  3703-3703  Mbgl-FontUtils          com.aopharm.openpharmacies           I  Couldn't map font family for local ideograph, using sans-serif instead
2024-04-15 11:24:41.650  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.683  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.683  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.685  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.686  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.686  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.688  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.689  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.689  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.690  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.691  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.691  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.692  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.694  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.696  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:41.699  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Skip render frame - NOT creating surface although renderNotSupported (false) || paused (true)
2024-04-15 11:24:42.195  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=16.83ms min=8.51ms max=34.95ms count=60
2024-04-15 11:24:42.250  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: onSurfaceDestroyed
2024-04-15 11:24:42.251  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: onSurfaceDestroyed: waiting until EGL will be cleaned up...
2024-04-15 11:24:42.251  3703-3759  Surface                 com.aopharm.openpharmacies           E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-04-15 11:24:42.253  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-EglCore]: EGL surface was destroyed.
2024-04-15 11:24:42.253  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: onSurfaceDestroyed: EGL resources were cleaned up.
2024-04-15 11:24:42.253  3703-3703  Surface                 com.aopharm.openpharmacies           E  freeAllBuffers: 1 buffers were freed while being dequeued!
2024-04-15 11:24:42.257  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\MapPluginRegistry]: Removed plugin: MAPBOX_ATTRIBUTION_COMPOSE_PLUGIN-0 from the Map.
2024-04-15 11:24:42.258  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\MapPluginRegistry]: Removed plugin: MAPBOX_SCALE_BAR_COMPOSE_PLUGIN-0 from the Map.
2024-04-15 11:24:42.320  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: destroy
2024-04-15 11:24:42.321  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: destroy: waiting until all resources will be cleaned up...
2024-04-15 11:24:42.917  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: Native renderer destroyed.
2024-04-15 11:24:42.917  3703-3759  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-EglCore]: EGL surface was already destroyed before.
2024-04-15 11:24:42.918  3703-3759  Surface                 com.aopharm.openpharmacies           E  getSlotFromBufferLocked: unknown buffer: 0x3f8000003e888889
2024-04-15 11:24:42.935  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: destroy: all resources were cleaned up.
2024-04-15 11:24:42.978  3703-3703  Mapbox                  com.aopharm.openpharmacies           I  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=false). Waiting for new one.
2024-04-15 11:24:42.981  3703-3703  Mapbox                  com.aopharm.openpharmacies           E  [maps-android\AnnotationManagerImpl]: Can't delete annotation: com.mapbox.maps.plugin.annotation.generated.PointAnnotation@ac20641, the annotation isn't an active annotation.
2024-04-15 11:24:42.982  3703-3703  Mapbox                  com.aopharm.openpharmacies           E  [maps-android\AnnotationManagerImpl]: Can't delete annotation: com.mapbox.maps.plugin.annotation.generated.PointAnnotation@9caa7e6, the annotation isn't an active annotation.
2024-04-15 11:24:42.982  3703-3703  Mapbox                  com.aopharm.openpharmacies           E  [maps-android\AnnotationManagerImpl]: Can't delete annotation: com.mapbox.maps.plugin.annotation.generated.PointAnnotation@c55c127, the annotation isn't an active annotation.
E  Many more...
2024-04-15 11:24:42.995  3703-3703  Choreographer           com.aopharm.openpharmacies           I  Skipped 44 frames!  The application may be doing too much work on its main thread.
2024-04-15 11:24:43.196  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=14.08ms min=3.69ms max=38.86ms count=59
2024-04-15 11:24:44.212  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=4.32ms min=3.68ms max=7.02ms count=61
2024-04-15 11:24:45.212  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=4.71ms min=3.46ms max=8.74ms count=60
2024-04-15 11:24:46.212  3703-3730  EGL_emulation           com.aopharm.openpharmacies           D  app_time_stats: avg=4.70ms min=3.65ms max=6.95ms count=60
2024-04-15 11:24:46.310  3703-3766  TrafficStats            com.aopharm.openpharmacies           D  tagSocket(82) with statsTag=0xffffffff, statsUid=-1

I try to use SymbolLayer but just don’t have find the way to make it work with compose, I will appreciate if you help me how to solve those (rookie) errors.

pengdev commented 5 months ago

@petrospap we do have a PointAnnotationGroupClustering example, if you don't need clustering feature, you can simply skip the annotation config. It's hard to say what went wrong in you project without some complete working code.