Hello there! I’m trying to load my ghz file to GraphHopper, but it doesn’t want to start. Can someone help me please with it?
There is Kotlin code where I provide location and profile to it.
val graphHopper = GraphHopper()
graphHopper.setGraphHopperLocation(location)
grapHopper.setProfiles(Profile("my"),setCustomModel(customModel)
graphHopper.load()
}
But I get this error and I don’t know how to deal with it.
exception
java.lang.IllegalArgumentException: Could not create weighting for profile: ‘car’.
Profile: … (created profile description)
Error: Cannot compile expression: can’t load this type of class file
at com.graphhopper.GraphHopper.checkProfilesConsistency(GraphHopper.java:1086)
at com.graphhopper.GraphHopper.load(GraphHopper.java:1061)
Yes, janino does not work on Android. See this comment.
However on the server or desktop you can use janino to create your own Weighting class and bundle the created code inside the jar file and use this for the weighting instead of custom (which uses janino). This avoids that janino is needed on Android. But this forces you to update the jar file whenever you update the weighting. See this discussion about iOS (but applies to Android too).