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

App Crashes while setting Navigation View #265

Open
punk39393 opened this issue Feb 10, 2025 · 1 comment
Open

App Crashes while setting Navigation View #265

punk39393 opened this issue Feb 10, 2025 · 1 comment
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. status: investigating The issue is under investigation, which is determined to be non-trivial. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@punk39393
Copy link

Environment details

App Crashed.
enabled maps sdk, for android and navigations api both
using android 11 for testing
working fine with your navigation app
i am using only for Android
pls help me what wrong i am doing

Code example

while setting view like this Future _initializeNavigationSession() async {
if (!await GoogleMapsNavigator.areTermsAccepted()) {
await GoogleMapsNavigator.showTermsAndConditionsDialog(
'My App',
'Logistics solutions',
);
}
await GoogleMapsNavigator.initializeNavigationSession();
setState(() {
_navigationSessionInitialized = true;
});
}

void _onViewCreated(GoogleNavigationViewController controller) async{
navigationViewController = controller;
await controller.setMyLocationEnabled(true);
await controller.setNavigationUIEnabled(true);
await GoogleMapsNavigator.setDestinations(Destinations(
waypoints: _waypoints,
displayOptions: NavigationDisplayOptions(
showDestinationMarkers: false,
showStopSigns: true,
showTrafficLights: true,
),
routingOptions: RoutingOptions(travelMode: NavigationTravelMode.driving),));

}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: curentLocation == null
? Center(
child: utils.iosProgressIndicator(AppColors.primaryThemeColor),
)
: SafeArea(
child: Stack(children: [
_navigationSessionInitialized ?
GoogleMapsNavigationView(
gestureRecognizers:Set()
..add(Factory(
() => PanGestureRecognizer()))
..add(Factory(
() => ScaleGestureRecognizer())) ,
onViewCreated: _onViewCreated,
initialMapType: MapType.normal,
initialNavigationUIEnabledPreference: NavigationUIEnabledPreference.automatic,
initialCameraPosition: CameraPosition(
target: curentLocation!,
zoom: 14,
),
):Center(child: utils.iosProgressIndicator(AppColors.primaryThemeColor),),

Following these steps will guarantee the quickest resolution possible.

Thanks!

@punk39393 punk39393 added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 10, 2025
@jokerttu
Copy link
Contributor

@punk39393, thanks for reporting this issue!

Could you check if the same issue occurs when running the example app? Additionally, please confirm that you have followed all the steps outlined in the README, particularly the requirements and installation sections.

If possible, please provide a crash report or any relevant logs to help us diagnose the problem. This will make it easier to identify the root cause.

Thanks!

@jokerttu jokerttu added status: investigating The issue is under investigation, which is determined to be non-trivial. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed triage me I really want to be triaged. labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. status: investigating The issue is under investigation, which is determined to be non-trivial. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants