eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
210 stars 163 forks source link

unable to display a map #345

Open abdoul-kader1 opened 5 months ago

abdoul-kader1 commented 5 months ago

I followed the steps to display a map but I receive this information in my console :

I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] attach
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] LifecycleOwner (com.mapbox.navigation.dropin.navigationview.NavigationViewModelLifecycleOwner@ef6f624) onCreate
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] changeState STARTED
D/RenderScript HIDL Adaptation(10951): IRenderScriptDevice::getService()
D/RenderScript HIDL Adaptation(10951): IRenderScriptDevice::getService() returned 0x0
D/RenderScript HIDL Adaptation(10951): Using Fallback Path.
D/le.oblack_drive(10951): Successfully queried cache dir: /data/user_de/0/com.example.oblack_drive/code_cache
D/RenderScript(10951): Setting cache dir: /data/user_de/0/com.example.oblack_drive/code_cache
I/Mapbox  (10951): [nav-sdk]: [MapboxNavigationOwner] onStart
I/Mapbox  (10951): [nav-sdk]: [HistoryFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-sdk]: [HistoryFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-sdk]: [RoutingTilesFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-native]: PersistentConfig path: /data/user/0/com.example.oblack_drive/files/mbx_nav/tiles/navigation/config.json
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
W/Mapbox  (10951): [config_service]: No configuration options found stored on the disk.
I/Mapbox  (10951): [valhalla]: virtual memory (Kb): 1.84649e+07 resident_set_size (Kb):  294392
I/Mapbox  (10951): [valhalla]: virtual memory (Kb): 1.84649e+07 resident_set_size (Kb):  294392
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [nav-sdk]: [RoutingTilesFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-native]: PersistentConfig path: /data/user/0/com.example.oblack_drive/files/mbx_nav/tiles/navigation/config.json
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
D/TrafficStats(10951): tagSocket(146) with statsTag=0xffffffff, statsUid=-1
I/Mapbox  (10951): [nav-native]: Tiles path = "/data/user/0/com.example.oblack_drive/files/mbx_nav/tiles"
I/Mapbox  (10951): [nav-native]: TileStore instance wasn't passed
I/Mapbox  (10951): [nav-native]: Endpoint config = "{"host":"https://api.mapbox.com","dataSet":"mapbox/driving-traffic","version":"","token":"***...*","isFallback":false,"versionBeforeFallback":"","minDiffInDaysToConsiderServerVersion":56}"
I/Mapbox  (10951): [nav-native]: Creating navigator v.157.0.0
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
D/TrafficStats(10951): tagSocket(147) with statsTag=0xffffffff, statsUid=-1
W/Mapbox  (10951): [config_service]: No configuration options found stored on the disk.
D/TrafficStats(10951): tagSocket(148) with statsTag=0xffffffff, statsUid=-1
D/TrafficStats(10951): tagSocket(155) with statsTag=0xffffffff, statsUid=-1
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [config_service]: No configuration options found stored on the disk.
D/TrafficStats(10951): tagSocket(167) with statsTag=0xffffffff, statsUid=-1
D/TrafficStats(10951): tagSocket(168) with statsTag=0xffffffff, statsUid=-1
D/TrafficStats(10951): tagSocket(174) with statsTag=0xffffffff, statsUid=-1
W/System  (10951): A resource failed to call destroy. 
W/System  (10951): A resource failed to call destroy. 
W/System  (10951): A resource failed to call destroy. 
I/Mapbox  (10951): [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=163 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x30000000 cmp=com.example.oblack_drive/.MainActivity (has extras) } baseActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} topActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} origActivity=null realActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} numActivities=1 lastActiveTime=9343275 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@9c7a041} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 144 - 0, 0) topActivityInfo=ActivityInfo{1939e6 com.example.oblack_drive.MainActivity} launchCookies=[] 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}
I/Mapbox  (10951): [nav-sdk]: [MapboxTripSession] routes update (reason: ROUTES_UPDATE_REASON_NEW, route IDs: []) - starting
I/Mapbox  (10951): [nav-native]: NavigatorImpl::resetRoutes finish the previous session
I/Mapbox  (10951): [nav-native]: Stopping online route requests in a loop as routes are null
I/Mapbox  (10951): [nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ ], removed=[ ]
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [nav-native]: Ride session reset
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
E/Mapbox  (10951): [events_service]: Events sending aborted
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
I/Mapbox  (10951): [nav-native]: Async version config for mapbox/driving-traffic resolved with version 2024_02_11-03_00_09 [{"map":{"tileset_version":"2024_02_11-03_00_09"}}]
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
I/Mapbox  (10951): [nav-native]: Async version config for mapbox/driving-traffic resolved with version 2024_02_11-03_00_09 [{"map":{"tileset_version":"2024_02_11-03_00_09"}}]
W/Mapbox  (10951): [nav-sdk]: [BillingController] [code: TokenValidationFailed, message: Token validation failed for: this-can-be-skip-since-we-set-it-later]
E/Mapbox  (10951): [nav-sdk]: [MapboxMetricsReporter] EventsService failure: [code: Unauthorized, message: Not Authorized] for events [appUserTurnstile]
E/Mapbox  (10951): [nav-sdk]: [MapboxMetricsReporter] Failed to send Turnstile event: [code: Unauthorized, message: Not Authorized]
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] attach
W/Mapbox  (10951): [nav-sdk]: [Companion] Unable to request location permissions when view is created late in the activity lifecycle. LifecycleOwner com.example.oblack_drive.MainActivity@db2a8cc is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED.
W/Mapbox  (10951): [LiveTrackingClient]: Skipping request to stop: state == Stopping
I/Mapbox  (10951): [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=163 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x30000000 cmp=com.example.oblack_drive/.MainActivity (has extras) } baseActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} topActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} origActivity=null realActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} numActivities=1 lastActiveTime=9343275 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@5979fe8} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 144 - 0, 0) topActivityInfo=ActivityInfo{9b7f601 com.example.oblack_drive.MainActivity} launchCookies=[] 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}
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [nav-native]: Ride session reset
I/Mapbox  (10951): [nav-sdk]: [MapboxNavigation] Trip session reset
I/Mapbox  (10951): [nav-sdk]: [MapboxTripSession] routes update (reason: ROUTES_UPDATE_REASON_CLEAN_UP, route IDs: []) - starting
I/Mapbox  (10951): [nav-sdk]: [MapboxNavigationOwner] disabled 12 observers
I/Mapbox  (10951): [nav-native]: Stopping online route requests in a loop as routes are null
I/Mapbox  (10951): [nav-sdk]: [MapboxNavigationOwner] onStart
I/Mapbox  (10951): [nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ ], removed=[ ]
I/Mapbox  (10951): [nav-sdk]: [HistoryFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-sdk]: [HistoryFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-sdk]: [RoutingTilesFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [nav-native]: PersistentConfig path: /data/user/0/com.example.oblack_drive/files/mbx_nav/tiles/navigation/config.json
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [nav-sdk]: [RoutingTilesFiles] Initial size is 4096 bytes
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
I/Mapbox  (10951): [nav-native]: PersistentConfig path: /data/user/0/com.example.oblack_drive/files/mbx_nav/tiles/navigation/config.json
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [nav-native]: Tiles path = "/data/user/0/com.example.oblack_drive/files/mbx_nav/tiles"
I/Mapbox  (10951): [nav-native]: TileStore instance wasn't passed
I/Mapbox  (10951): [nav-native]: Endpoint config = "{"host":"https://api.mapbox.com","dataSet":"mapbox/driving-traffic","version":"","token":"***...*","isFallback":false,"versionBeforeFallback":"","minDiffInDaysToConsiderServerVersion":56}"
I/Mapbox  (10951): [nav-native]: Creating navigator v.157.0.0
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [threading]: Worker 1 priority is now 4
D/TrafficStats(10951): tagSocket(164) with statsTag=0xffffffff, statsUid=-1
I/Mapbox  (10951): [LifecycleUtils]: Task: TaskInfo{userId=0 taskId=163 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x30000000 cmp=com.example.oblack_drive/.MainActivity (has extras) } baseActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} topActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} origActivity=null realActivity=ComponentInfo{com.example.oblack_drive/com.example.oblack_drive.MainActivity} numActivities=1 lastActiveTime=9343275 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@823b045} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 144 - 0, 0) topActivityInfo=ActivityInfo{145439a com.example.oblack_drive.MainActivity} launchCookies=[] 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}
I/Mapbox  (10951): [nav-native]: Async version config for mapbox/driving-traffic resolved with version 2024_02_11-03_00_09 [{"map":{"tileset_version":"2024_02_11-03_00_09"}}]
I/le.oblack_drive(10951): Background concurrent copying GC freed 52766(2423KB) AllocSpace objects, 16(320KB) LOS objects, 49% free, 6741KB/13MB, paused 1.202ms,115us total 179.011ms
W/Mapbox  (10951): [events_service]: Failed to flush 0 event(s): events dispatch disabled
I/Mapbox  (10951): [nav-native]: Async version config for mapbox/driving-traffic resolved with version 2024_02_11-03_00_09 [{"map":{"tileset_version":"2024_02_11-03_00_09"}}]
I/Mapbox  (10951): [nav-sdk]: [MapboxTripSession] routes update (reason: ROUTES_UPDATE_REASON_NEW, route IDs: []) - starting
I/Mapbox  (10951): [nav-native]: NavigatorImpl::resetRoutes finish the previous session
I/Mapbox  (10951): [nav-native]: Stopping online route requests in a loop as routes are null
I/Mapbox  (10951): [nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ ], removed=[ ]
W/Mapbox  (10951): [valhalla]: No metadata found for tiles
I/Mapbox  (10951): [nav-native]: Ride session reset
I/TextToSpeech(10951): Sucessfully bound to com.google.android.tts
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] attach
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] LifecycleOwner (com.example.oblack_drive.MainActivity@db2a8cc) onCreate
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] LifecycleOwner (com.example.oblack_drive.MainActivity@db2a8cc) onStart
I/Mapbox  (10951): [nav-sdk]: [CarAppLifecycleOwner] changeState RESUMED
E/MethodChannel#flutter/platform_views(10951): Failed to handle method call
E/MethodChannel#flutter/platform_views(10951): java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Boolean
E/MethodChannel#flutter/platform_views(10951):  at com.eopeter.fluttermapboxnavigation.models.views.EmbeddedNavigationMapView.initialize(EmbeddedNavigationMapView.kt:36)
E/MethodChannel#flutter/platform_views(10951):  at com.eopeter.fluttermapboxnavigation.factory.EmbeddedNavigationViewFactory.create(EmbeddedNavigationViewFactory.kt:33)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:520)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsController.java:165)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:105)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#flutter/platform_views(10951):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#flutter/platform_views(10951):  at android.os.Handler.handleCallback(Handler.java:958)
E/MethodChannel#flutter/platform_views(10951):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter/platform_views(10951):  at android.os.Looper.loopOnce(Looper.java:205)
E/MethodChannel#flutter/platform_views(10951):  at android.os.Looper.loop(Looper.java:294)
E/MethodChannel#flutter/platform_views(10951):  at android.app.ActivityThread.main(ActivityThread.java:8177)
E/MethodChannel#flutter/platform_views(10951):  at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/platform_views(10951):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/MethodChannel#flutter/platform_views(10951):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
I/Mapbox  (10951): [nav-sdk]: [MapboxTripSession] routes update (reason: ROUTES_UPDATE_REASON_NEW, route IDs: []) - finished
I/Mapbox  (10951): [nav-sdk]: [RouteAlternativesController] native alternatives available: []
I/Choreographer(10951): Skipped 376 frames!  The application may be doing too much work on its main thread.
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
E/flutter (10951): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, null cannot be cast to non-null type kotlin.Boolean, null, java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Boolean
E/flutter (10951):  at com.eopeter.fluttermapboxnavigation.models.views.EmbeddedNavigationMapView.initialize(EmbeddedNavigationMapView.kt:36)
E/flutter (10951):  at com.eopeter.fluttermapboxnavigation.factory.EmbeddedNavigationViewFactory.create(EmbeddedNavigationViewFactory.kt:33)
E/flutter (10951):  at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:520)
E/flutter (10951):  at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsController.java:165)
E/flutter (10951):  at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:105)
E/flutter (10951):  at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)
E/flutter (10951):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter (10951):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (10951):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter (10951):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (10951):  at android.os.Handler.handleCallback(Handler.java:958)
E/flutter (10951):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (10951):  at android.os.Looper.loopOnce(Looper.java:205)
E/flutter (10951):  at android.os.Looper.loop(Looper.java:294)
E/flutter (10951):  at android.app.ActivityThread.main(ActivityThread.java:8177)
E/flutter (10951):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter (10951):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/flutter (10951):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/flutter (10951): )
E/flutter (10951): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (10951): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter (10951): <asynchronous suspension>
E/flutter (10951): #2      ExpensiveAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1081:5)
E/flutter (10951): <asynchronous suspension>
E/flutter (10951): #3      AndroidViewController.create (package:flutter/src/services/platform_views.dart:804:5)
E/flutter (10951): <asynchronous suspension>
E/flutter (10951): 
W/le.oblack_drive(10951): Accessing hidden field Landroid/app/ActivityThread;->mServices:Landroid/util/ArrayMap; (unsupported, reflection, allowed)
D/LeakCanary(10951): Watching instance of com.mapbox.navigation.core.trip.service.NavigationNotificationService (com.mapbox.navigation.core.trip.service.NavigationNotificationService received Service#onDestroy() callback) with key 0b8b5405-2bc8-478d-b9ee-1632364c8c11
I/Mapbox  (10951): [tile_store]: Searching for stale partial downloads to clean up
I/Mapbox  (10951): [tile_store]: Cleanup of stray partial downloads complete
W/Mapbox  (10951): [nav-sdk]: [TripSessionLocationEngine] Got an obsolete location: age = 41257 ms
W/Mapbox  (10951): [nav-sdk]: [BillingController] [code: TokenValidationFailed, message: Token validation failed for: this-can-be-skip-since-we-set-it-later]
I/Mapbox  (10951): [nav-sdk]: [MapboxNavigation] Trip session reset
I/Choreographer(10951): Skipped 50 frames!  The application may be doing too much work on its main thread.
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
E/Mapbox  (10951): [config_service]: Configuration request aborted after 2 attempts
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
E/Mapbox  (10951): [config_service]: Configuration request aborted after 2 attempts
W/Mapbox  (10951): [config_service]: Unexpected HTTP response code is received: 401
E/Mapbox  (10951): [config_service]: Configuration request aborted after 2 attempts
I/Mapbox  (10951): [tile_store]: Searching for stale partial downloads to clean up
I/Mapbox  (10951): [tile_store]: Cleanup of stray partial downloads complete
I/le.oblack_drive(10951): Explicit concurrent copying GC freed 25376(1389KB) AllocSpace objects, 20(400KB) LOS objects, 49% free, 6171KB/12MB, paused 941us,561us total 143.346ms
I/TextToSpeech(10951): Connected to TTS engine
I/TextToSpeech(10951): Setting up the connection to TTS engine...
W/Mapbox  (10951): [nav-native]: Got location timestamp from the past: 9478591643300ns <= 9478592488700ns. No status will be produced.
W/Mapbox  (10951): [events_service]: Failed to flush 2 event(s): events dispatch disabled
D/TrafficStats(10951): tagSocket(147) with statsTag=0xffffffff, statsUid=-1
W/Mapbox  (10951): [nav-native]: Got location timestamp from the past: 9554596425000ns <= 9554598838000ns. No status will be produced.
W/Mapbox  (10951): [nav-native]: Got location timestamp from the past: 9594600709000ns <= 9594601426700ns. No status will be produced.
W/Mapbox  (10951): [nav-native]: Got location timestamp from the past: 9633604385900ns <= 9633608318100ns. No status will be produced.
W/Mapbox  (10951): [nav-native]: Got location timestamp from the past: 9642603402300ns <= 9642604432800ns. No status will be produced.
eopeter commented 5 months ago

Seems you didn't follow the instruction to correctly set your MapBox access token hence you are getting a 401 unauthorized error

abdoul-kader1 commented 5 months ago

I followed the instructions, I created an xml file in the resources of my kotlin folder

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
    <string name="mapbox_access_token" translatable="false" tools:ignore="UnusedResources">my public token</string>
</resources>

then I added the permissions in androidMinifdest

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

then in the gradle.properties I added my secret token

org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
MAPBOX_DOWNLOADS_TOKEN=my secret token

and finally I changed the FlutterActivity to FlutterFragmentActivity in the MainActivity file in my kotlin folder and add "implementation platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")android/app/build.gradle" in the build.gradle located in the app folder of the native android folder

package com.example.oblack_drive

//import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {

}
plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

android {
    namespace "com.example.oblack_drive"
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.oblack_drive"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName

    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

}

flutter {
    source '../..'
}

dependencies {
    implementation platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")
}
abdoul-kader1 commented 5 months ago

@eopeter ?

eopeter commented 5 months ago

Please follow the instruction on how to properly set up your mapbox access and download tokens

abdoul-kader1 commented 5 months ago

@eopeter I configured the public and private tokens, for the public scope all the boxes were checked since it is the default token, now for the private scope I only checked the download box

eopeter commented 5 months ago

Follow the instruction on the ReadMe on how to set the token. You are getting a 401 which means you didn't set the token properly

abdoul-kader1 commented 5 months ago

I also followed the configuration instructions for Android I even put the steps higher in the conversation. when I build the application for the first time I receive a ton of information in the console as well as the 401 message but when I do a hot reload I no longer have the 401 message but the other information from my console is displayed

abdoul-kader1 commented 5 months ago

Hello, thank you for your availability I was able to resolve the problem

eopeter commented 5 months ago

How did you resolve it? Is there a step missing in the instruction that was not clear on how to setup your access token?

abdoul-kader1 commented 5 months ago

there was no problem with the token configuration but rather with how I used the MapBoxNavigationView widget. I called this widget without the properties or methods that allow me to start a navigation thinking that the package could show me just a map without starting the navigation, the absence of these properties or methods throws the 401 error

luismlg commented 3 months ago

@abdoul-kader1 I have the same problem, can you tell me how you solved it? I'm going crazy!

abdoul-kader1 commented 3 months ago

Wait, I'm publishing a test usage demo on my GitHub

milad-a-kareem commented 3 months ago

I suggest visiting the following example: https://github.com/codewithdarkwa/turn-by-turn-navigation-flutter