When using Google Maps PolyUtil.decode it gives me this error java.lang.StringIndexOutOfBoundsException: length=60; index=60 at java.lang.String.charAt(Native Method) at com.google.maps.android.PolyUtil.decode(PolyUtil.java:464)
When I trace the error it gives me the PolyUtil.class which then takes me to this particular line
do{
b = encodedPath.charAt(index++) - 63 - 1;
result += b << shift;
shift += 5;
} while(b >= 31);
But so far this error is only thrown for a particular encoded string. When I decode another encoded string of the same length in characters or one that is longer or shorter in length it doesn't throw the error. I've even tested the string that gives the error using Google's Interactive Polyline Decoder Tool and it shows up properly. Any reason why this error is being thrown happen?