Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the user's location failed #2427

Open
zhichaoZhang opened this issue Jul 12, 2024 · 3 comments
Open

Display the user's location failed #2427

zhichaoZhang opened this issue Jul 12, 2024 · 3 comments
Labels
bug 🪲 Something isn't working

Comments

@zhichaoZhang
Copy link

zhichaoZhang commented Jul 12, 2024

Environment

  • Android OS version: Android 14
  • Devices affected: Pixel 5
  • Maps SDK Version: Mapbox common SDK v24.5.0 Mapbox Core Maps SDK v11.5.1

Observed behavior and steps to reproduce

Run the Mapbox Maps Android project and enter the user location display page, but the current location cannot be displayed.

The log is as follows:

17:32:35.358 28395-28395 Mapbox I [common]: Using Mapbox Common SDK v24.5.0(edbe9cbfd)
17:32:35.402 28395-28395 Mapbox I [maps-core]: Using Mapbox Core Maps SDK v11.5.1(47046e34d8)
17:32:35.416 28395-28418 Mapbox I [MapboxReachability]: Application permission for ACCESS_NETWORK_STATE granted
17:32:35.723 28395-28435 Mapbox I [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=901 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mapbox.maps.testapp/.ExampleOverviewActivity } baseActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} topActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} origActivity=null realActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} numActivities=1 lastActiveTime=75089755 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@9825e12} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{917b9e3 com.mapbox.maps.testapp.ExampleOverviewActivity} launchCookies=[android.os.BinderProxy@24f7fe0] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}
17:32:35.800 28395-28435 Mapbox I [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=901 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mapbox.maps.testapp/.ExampleOverviewActivity } baseActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} topActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} origActivity=null realActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} numActivities=1 lastActiveTime=75089755 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@b4098d4} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{109da7d com.mapbox.maps.testapp.ExampleOverviewActivity} launchCookies=[android.os.BinderProxy@24f7fe0] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}
17:32:58.405 28395-28420 Mapbox I [metrics]: Metrics collection period: 0s
17:32:58.491 28395-28419 Mapbox I [metrics]: Metrics collection period: 0s
17:32:58.498 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
17:32:58.587 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
17:32:58.588 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
17:32:58.625 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: Renderer resumed, renderThreadPrepared=false, surface.isValid=null
17:32:58.625 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
17:32:58.643 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
17:32:58.646 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: onSurfaceCreated
17:32:58.646 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: onSurfaceCreated: waiting Android surface to be processed...
17:32:58.647 28395-28669 Mapbox I [maps-android\Mbgl-RenderThread]: Setting up render thread, flags: creatingSurface=true, nativeRenderCreated=false, eglContextMadeCurrent=false, eglContextCreated=false, paused=false
17:32:58.648 28395-28669 Mapbox I [maps-android\Mbgl-EGLConfigChooser]: In emulator: false
17:32:58.650 28395-28669 Mapbox I [maps-android\Mbgl-EglCore]: EGLContext created, client version 3
17:32:58.650 28395-28669 Mapbox I [maps-core]: Using OpenGL render backend
17:32:58.651 28395-28669 Mapbox I [maps-android\Mbgl-RenderThread]: Native renderer created.
17:32:58.651 28395-28395 Mapbox I [maps-android\Mbgl-RenderThread]: onSurfaceCreated: Android surface was processed.
17:32:58.766 28395-28395 Mapbox E [maps-android\LocationPuck2D]: No image holder data for mapbox-location-top-icon!
17:32:58.788 28395-28395 Mapbox E [maps-android\LocationPuck2D]: No image holder data for mapbox-location-top-icon!
17:33:03.415 28395-28670 Mapbox I [tile_store]: Searching for stray files to clean up
17:33:03.418 28395-28670 Mapbox I [tile_store]: Cleanup of stray partial downloads complete
17:33:03.419 28395-28670 Mapbox I [tile_store]: Searching for stale partial downloads to clean up
17:33:03.421 28395-28670 Mapbox I [tile_store]: Cleanup of stray partial downloads complete
17:33:03.784 28395-28419 Mapbox E [events_service]: Events sending aborted after 2 attempts
17:33:03.786 28395-28419 Mapbox E [maps-android\MapTelemetryImpl]: sendTurnstileEvent error: [code: HttpError, message: Failed to connect to events.mapbox.com/0.0.0.0:443]

Screenshot below:

Screenshot_20240712-175811

Expected behavior

should be positioned successfully

Notes / preliminary analysis

I tried running the same code on other phones, and it successfully positioned and displayed the current location.
It should be that the positioning failed, but I don’t know why.

Additional links and references

@zhichaoZhang zhichaoZhang added the bug 🪲 Something isn't working label Jul 12, 2024
@bytebitx
Copy link

I encountered the same problem, is there a solution?

@kiryldz
Copy link
Contributor

kiryldz commented Jul 23, 2024

@bytebitx @zhichaoZhang please provide sample project reproducing the issue.

@bytebitx
Copy link

class MapBoxViewActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_map_box)
    with(findViewById<MapView>(R.id.mapView)) {
        // 设置地图样式
        mapboxMap.loadStyle(Style.SATELLITE)

        location.locationPuck = createDefault2DPuck(true)
        location.enabled = true
        location.puckBearing = PuckBearing.COURSE
        viewport.transitionTo(
            targetState = viewport.makeFollowPuckViewportState(
                FollowPuckViewportStateOptions.Builder()
                    .zoom(12.0)
                    .pitch(0.0)
                    .build()
            ),
            transition = viewport.makeImmediateViewportTransition()
        )
    }
}

}

<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.mapbox.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

RhoBus pushed a commit to RhoBus/mapbox-maps-android that referenced this issue Aug 6, 2024
* Compose Terrain support

* PR fixes

* Treat the terrain dem source fully as a layer

---------

Co-authored-by: Ramon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants