I had the same exception, the solution was to review the SpatialReference of service and application, use the same in both, if the service has a different SpatialReference then you will find no location. eg, uses for GPS 4326.
I hope it helps.
Example:
if you declare SpatialReference at
private SpatialReference wm,egs;
......
wm = SpatialReference.create(102100);
egs = SpatialReference.create(4326);
then make sure your MapService SpatialReference is:
Spatial Reference: 102100 (4326)
(If you are using Esri MapService and NAService services in the Routing example https://developers.arcgis.com/android/sample-code/routing/ do not need to worry about that)
Now you can convert the screen point in onLongPressListener
Point loc = map.toMapPoint(x, y);
Point p = (Point) GeometryEngine.project(loc, wm, egs);
/*initialize RouteTask*/
RouteTask rt = RouteTask.createOnlineRouteTask("your service url",null);
RouteParameters rp = rt.retrieveDefaultRouteTaskParameters();
NAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();
//mlocation is your latitude and longitude point provided by GPS location in decimal degrees
StopGraphic point1 = new StopGraphic(mlocation);
StopGraphic point2 = new StopGraphic(p);
rfaf.setFeatures(new Graphic[]{point1,point2});
rfaf.setCompressedRequest(true);
rp.setStops(rfaf);
rp.setOutSpatialReference(wm);
RouteResult mresults = rt.solve(rp);
It works fine for me.