Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Onclick StartNavigation Crash #689

Open
rspapneja opened this issue Aug 9, 2021 · 0 comments
Open

Onclick StartNavigation Crash #689

rspapneja opened this issue Aug 9, 2021 · 0 comments
Labels

Comments

@rspapneja
Copy link

I am trying to create navigation between to locations.
I am using MAPVIEW for tracking or showing on screen. But, When i click on start navigation button App getting creashed with that error. Error showing below. If anybody have any solution please help me..
//==========================================================
button.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
boolean simulateRoute = true;
NavigationLauncherOptions options = NavigationLauncherOptions.builder()
.directionsRoute(currentRoute)
.shouldSimulateRoute(simulateRoute)
.build();
// Call this method with Context from within an Activity
NavigationLauncher.startNavigation(NavigationMapClass.this, options);
}
});

//============================================================

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toyota.navigationmapboxapp/com.mapbox.services.android.navigation.ui.v5.MapboxNavigationActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.mapbox.services.android.navigation.ui.v5.NavigationView.onCreate(android.os.Bundle)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.mapbox.services.android.navigation.ui.v5.NavigationView.onCreate(android.os.Bundle)' on a null object reference
at com.mapbox.services.android.navigation.ui.v5.MapboxNavigationActivity.onCreate(MapboxNavigationActivity.java:32)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)

@stale stale bot added the archived label Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant