Search code examples
androidgraphhoppermapsforge

GraphHopper error : Encoder car was used in version 1, but current version is 2


I used graphhopper for offline maps and routing, and it worked. Few months after, I started the app and it crashed with error : Encoder car was used in version 1, but current version is 2. I don't know if I did something to cause this, or something got updated, either way I don't know the solution.

On graphhopper github page same issue is submitted but without answer.

Error leads me to this line in EncodingManager.class :

PMap configuration = new PMap(entryVal);
FlagEncoder fe = factory.createFlagEncoder(entry, configuration);
if (configuration.has("version") && fe.getVersion() != 
configuration.getInt("version", -1)) {
    throw new IllegalArgumentException("Encoder " + entry + " was used in 
    version " + configuration.getLong("version", -1L) + ", but current 
    version is " + fe.getVersion());
}

Solution

  • The problem is that we released a new APK 0.12 without updating the graph data. This is necessary as there was an incompatible change. We'll do so in the next hours. As a workaround you can try 0.11.

    https://github.com/graphhopper/graphhopper/#get-started

    Update: the data is now updated for 0.12. Please also re-install the 0.12 apk if you installed it before as we made a mistake when we published it.