Nullpointer Exception when importing gpx file

63 views
Skip to first unread message

Dirk Waltert

unread,
Aug 15, 2016, 6:08:44 AM8/15/16
to Osmand
Hi there,

I just tried to import a gpx file I successfully imported in an older Version (unfortunately I don't know the version number, but it was about Mai '16).
Now I get the following exception:

15.08.2016 11:14:26
Apk Version : 2.4.3 243
Exception occured in thread Thread[AsyncTask #2,5,main] : 
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NullPointerException: Attempt to read from field 'java.util.List net.osmand.plus.GPXUtilities$GPXFile.points' on a null object reference
at net.osmand.plus.helpers.GpxImportHelper$3.doInBackground(GpxImportHelper.java:178)
at net.osmand.plus.helpers.GpxImportHelper$3.doInBackground(GpxImportHelper.java:168)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more


I validated the gpx data using several tools and they say the gpx is valid.
(generated using the page motoplaner.de )
I also tried several gpx files (all from motoplaner.de but as mentioned formerly they worked with OSMAND+)

Any advice/help?

Thanks in advance.
Message has been deleted

Dirk Waltert

unread,
Aug 15, 2016, 6:26:03 AM8/15/16
to Osmand
Just one thing i forgot to mention.

If I try to safe the file I just get "error while reading the GPX data" but OSMAND does not crash as I does during import.

Edit: Seems to work if I put the file in thosmand/tracks/(optional_sub-folder)/your_file.gpx folder.
So the transition using "open file with" in this case with owncloud sync folder to OSMAND seems to fail.

Harry van der Wolf

unread,
Aug 15, 2016, 7:50:47 AM8/15/16
to osmand
I do agree that it is a bug, but ...
- Importing a gpx file is what you do with waypoints: you add them to your favorites.
- Storing a gpx file is what you do with a track or route file which you want to use later for navigation.

A lot of users don't know this and I agree that OsmAnd doesn't make this clear to the user. 
And yes: If you try to import a route or track file, OsmAnd should simply say so and not crash.

Harry

--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages