Just fyi: there is some work going on in the currently outdated repo of the GraphHopper iOS port: https://github.com/graphhopper/graphhopper-ios/pull/47
Is there any progress on this? Still cannot compile any of the ios projects on GitHub.
Did you try the pull request? If yes, can you be more specific what you did step-by-step and what problems you got (error message etc)
I followed the instructions at https://github.com/oflebbe/graphhopper-ios
git clone --recursive https://github.com/graphhopper/graphhopper-ios.git
running “make translate” produced the following error:
make: *** No rule to make target
dependencies/hppc/com/carrotsearch/hppc/AbstractByteCollection.java', needed by src/.translate_mark’. Stop.
I’m trying to compile graphhopper 1.0 for iOS (0.8.2 has some issues that will be hopefully fixed by this).
I used oflebbe’s graphhopper-ios as starting point but got the same error message concerning com/carrotsearch/hppc/AbstractByteCollection.java
And there are a few things that confuse me:
- It seems like AbstractByteCollection.java participates only in web target. Maybe it’s safe to remove it?
GitHub - carrotsearch/hppc: High Performance Primitive Collections for Java doesn’t seem to have such class at all (I have checked releases down to 0.7.3), although here it was fetched from release 0.8.1
Same goes for AbstractCharCollection, AbstractDoubleCollection e.t.c.
Only AbstractIterator.java was and remains part of com.carrotsearch/hppc since 0.7.0 at least.
I’m complete novice in java world so maybe I miss something there.
If @karussell could kindly provide some input on this matter this will help a lot.
I’ve managed to run iOS example app using ios_compatibility branch. I will create necessary instructions and PR’s after I do some more tests.
There are still two issues that need to be addressed:
After translation from java to Obj-C one line seems to be broken.
/graphhopper-ios/src/com/graphhopper/util/TranslationMap.m line 96 states:
[trMap doImportWithJavaIoInputStream:[TranslationMap_class_() getResourceAsStream:JreStrcat("$$", locale, @".txt")]];
and this produces error on localisations loading because
[TranslationMap_class_() getResourceAsStream:JreStrcat("$$", locale, @".txt")]returns
The problem is that to get proper stream file name should start with “/”. So when I change line 96 to:
[trMap doImportWithJavaIoInputStream:[TranslationMap_class_() getResourceAsStream:JreStrcat("$$$", @"/", locale, @".txt")]];it works as expected.
But this is not ideal as translated classes are not part of the repo and could be re-generated any time. I suppose this is either an error in original java code or some glitch from j2objc. I would be happy to hear any input about this. In worst case I will add this fix to instruction.
Branch ios_compatibility doesn’t correlate to final 1.0 state. It seems to be branched around https://github.com/graphhopper/graphhopper/releases/tag/1.0-pre34 Because of this when I used pure 1.0 graphhopper to generate routing files they were not fully compatible. So will try to merge graphopper 1.0 to ios_compatibility branch but with my limited knowledge of java this could easily fail. It would be awesome if @karussell would be so kind to do this.
Any news here? I can’t compile the branches. I need a GraphHopper build which is working for Xcode 12, maybe Xcode 13.