GH: An error happened while creating graph:length=0; regionStart=1; regionLength=-2

First I have tested your APK that is working fine in my real device. After I have installed your android code in the android studio and run it. In App, download specific area from the remote and open map from locally. After I got an issue in the map I can’t tap to set a pin for getting a distance. I showed you log below

E/GH: loading graph (0.12)
com.graphhopper.android E/o*.o*.r*.GLUtils: glCreateProgram: glError 1280
com.graphhopper.android E/GH: An error happened while creating graph:length=0; regionStart=1; regionLength=-2

After that, I got toast “Finished loading graph. Long press to define where to start and end the route.”

So please let me know what’s the problem?

Please describe what you did in more detail, so that one can easier help you. If the APIK works fine, why did you get a problem?

I said, Your apk work fine and also code running in android studio fine, but getting me an error with that which I have posted before.

I didn’t change in your published code on Github, but while open app and download any map like “europe_germany_berlin” from remote and open for locally to show the only map and give me an error in logcat and show toast

E/GH: loading graph (0.12)
com.graphhopper.android E/o*.o*.r*.GLUtils: glCreateProgram: glError 1280
com.graphhopper.android E/GH: An error happened while creating graph:length=0; regionStart=1; regionLength=-2

After that, I got toast “Finished loading graph. Long press to define where to start and end the route.”

I have sent you one video which is debug app installed from the android studio. and I didn’t change any code in your sample code. make sure what’s the issue?

In the last when I long press on the map at that time give me an error “Finished loading graph. Long press to define where to start and end the route”.

Make sure you copied all files. Furthermore there should be an exception in the logs which gives you more information like the stack trace

I have fully download source code from github and run this code. And there were nothing any logcat printed except which i have sent you allready. I know you are confused regarding my issue. So please check my issue and video to get more understand that.

Hello,
Could you please help me out this issue?

This text will be hiddenLogcat.txt (2.7 KB)

Please find an attachment to see my logcat.

Seems the apk and the cloned source code are not the same version (0.10 vs 0.12).
Better try apk and source code from latest GraphHopper release instead.
Uninstall the old app and delete graph folder too, before install again on device.

I have cloned latest source code from GitHub and compile it to the android studio then run this code to my android phone directly before I did delete cache, folder from sd card and uninstall old apk too. so how it’s possible to a different version. and also I didn’t change any code in your cloned source code so might be an issue is different here, that’s why I have shared you via video and logcat.

How to load different map and route except spinner item selecting?

Can see documentation Android & Java for how create and use graphs.
Also can study sample’s code to understand how all these run together.

Yeah It’s the same with me " an error happened while creating graph length=0; regionStart=1; regionLength=2 " while giving a long press to mark the starting point.(europe_germany_berlin map and its the same with all)
The log is:
2019-02-14 12:33:06.303 11784-12122/com.graphhopper.android E/o*.o*.r*.GLUtils: glCreateProgram: glError 1280

Please,Let me know what I have missed or how you have cleared it.!!

See this link. It will solve your problem.

2 Likes

YEAH!!Thanksss!!