GHResponse on null Object reference PID:13431

I have tried to clone the 6.0 version of graphhopper using git,
I want 5.0 version but i dont think that version has shortest path settings.
So I cloned the 6.0 version and I am receving this.

? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.juandirection.juand, PID: 13431
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘com.graphhopper.GHResponse com.graphhopper.GraphHopper.route(com.graphhopper.GHRequest)’ on a null object reference
at com.juandirection.juand.fragments.FragmentMap$2.doInBackground(FragmentMap.java:213)
at com.juandirection.juand.fragments.FragmentMap$2.doInBackground(FragmentMap.java:203)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

Tried the new version and its still the same.
Does this has to do with the OSM file?
THanks

Shortest path routing was present in past GH versions too, depending on speed-up or flexibility mode used.

The exception declares a NPE in your code, did you debug it to find the null object?

Emux

yes i debug it.
I also used the 5.0 and import using my osm,
in my settings shortest is included but the files I recived after import is only the fastest.

anyone please? I need help. still got the problem.

The NPE is outside of GH and we cannot help you much. Maybe an import or graph load problem then we need to know the error logs.

can i ask what does NPE means?

Caused by: java.lang.NullPointerException: Attempt to invoke virtual
method ‘com.graphhopper.GHResponse
com.graphhopper.GraphHopper.route(com.graphhopper.GHRequest)’ on a null
object reference

ohh sorry. thought it means much more. I am having the same problem even if it is version 7.0-SNAP or 6.0 RC-2… what could be the problem?

That is a Null Pointer Exception on some object reference.

I suggest to debug your code and see what object is null and why.

I clone the project (6.0) and run the app.
I used my map with the settings of fastest and shortest…
together with car,bike,walk.

While using the cloned app together with my Imported OSM file.(philippines-latest.osm)
I received this error,

An Error happened while creating graph.Configured graph.chWeightings:[fastest|car,fastest|bike,fastest|foot] is not equal to loaded [fastest|car,shortest|car,fastest|bike,shortest|bike,fastest|foot,shortest|foot]

Anyone who can help me pls?

Try to use the same profiles for the import that are configured in your Android app. E.g. if you have fastest|car imported you need to configure your app accordingly.

PS: Please avoid triggering us with additional posts. You’ll force people to de-subscribe from your topic :wink: