GraphHopper.com | Forum | GitHub | Maps | Blog

iOS project does not build


#1

After cloning it, the project does not build.
The import com.carrotsearch cannot be resolved
And this results in 382 other errors.

Can you please advise.


#2

I think @calin is currently trying hard to refactor everything for the latest 0.9.0 version to compile again with j2objc. Can you try with the previous 0.8 effort instead?


#3

Thank you. the graphhopper-ios repo was already on 0.8.2, but not the submodule.

The above is resolved, but now I see these errors:

Translated 287 files: 36 errors, 0 warnings
error: graphhopper/core/src/main/java/com/graphhopper/util/Helper.java:394: The method gc() is undefined for the type System
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:94: The method reallocateMemory(long, long) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:101: The method setMemory(long, long, byte) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:182: The method freeMemory(long) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:187: The method putInt(Object, long, int) in the type Unsafe is not applicable for the arguments (long, int)
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:192: The method getInt(Object, long) in the type Unsafe is not applicable for the arguments (long)
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:197: The method getShort(long) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:202: The method putShort(long, short) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:208: The method putByte(long, byte) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/storage/UnsafeDataAccess.java:216: The method getByte(long) is undefined for the type Unsafe
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:26: The import org.apache.xmlgraphics cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:27: The import org.apache.xmlgraphics cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:28: The import org.apache.xmlgraphics cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:32: The import java.awt cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:225: Raster cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:226: SeekableStream cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:236: SeekableStream cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:237: TIFFImageDecoder cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:237: TIFFImageDecoder cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/CGIARProvider.java:237: TIFFDecodeParam cannot be resolved to a type
translating graphhopper/core/src/main/java/com/graphhopper/reader/dem/ElevationInterpolator.java
translating graphhopper/core/src/main/java/com/graphhopper/reader/dem/ElevationProvider.java
translating graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:22: The import javax.imageio cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:23: The import java.awt cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:24: The import java.awt cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:126: ImageIO cannot be resolved
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:126: The method makeARGB() from the type HeightTile refers to the missing type BufferedImage
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:129: BufferedImage cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:131: BufferedImage cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:131: BufferedImage cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:131: BufferedImage cannot be resolved to a variable
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:132: Graphics cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:140: Color cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:149: Color cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:157: BufferedImage cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:159: BufferedImage cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:159: BufferedImage cannot be resolved to a type
error: graphhopper/core/src/main/java/com/graphhopper/reader/dem/HeightTile.java:159: BufferedImage cannot be resolved to a variable

#4

@karussell, @calin, we have a very tough deadline with our app, and we are willing to pay for your extra support on integrating this library.


#5

Currently the 0.9.0 version is in development, but you can use 0.8.2. I just tested it to confirm it is working. Here are the steps/commands that I used, please use the same:

git clone https://github.com/graphhopper/graphhopper-ios
cd graphhopper-ios/
git checkout 0.8.2
git submodule update --init
./graphhopper-ios-sample/import-sample.sh
git submodule update

Now, open the Xcode project at graphhopper-ios/graphhopper-ios-sample/graphhopper-ios-sample.xcodeproj , make sure the “graphhopper-ios-sample” target is selected (instead of the “graphhopper” one) and hit Build or Run. The project will build successfully.

Keep in mind that the sample app is using an older MBXMapKit, so the map and the drawn route are just for demo purposes, and bugs can be found. However, a basic example on how to use the GraphHopper library can be found in Directions.m.


#6

Thanks very much. It works! Must have been something with the submodules then.
I will now try to move this into our project.


#7

These steps doesn’t seem to be working now, any new steps?

Thanks.