Closed aleonnet closed 10 months ago
Look at the Manifest section here: https://docs.mapbox.com/android/navigation/guides/get-started/install/
I haven't added the instructions/documentation for adding permissions etc but you haven't added the ACCESS_COARSE_LOCATION and ACCESS_FILE_LOCATION permissions to your manifest.
It also looks like you haven't initialized the map object before trying to use it. Have a look at the example in the examples folder.
Hi @josephcrowell! Cannot see any map on Android.
I got an initialization error << E/MethodChannel#flutter_mapbox_turn_by_turn/method(23853): kotlin.UninitializedPropertyAccessException: lateinit property context has not been initialized
And changed the following on FlutterMapboxTurnByTurnPlugin.kt:
private fun isPermissionGranted(): Boolean { if (!::context.isInitialized) { Log.e("FlutterMapboxTurnByTurnPlugin", "Context has not been initialized yet.") return false }
val coarseResult: Int = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) val fineResult: Int = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)
return coarseResult == PackageManager.PERMISSION_GRANTED && fineResult == PackageManager.PERMISSION_GRANTED }