Compilation for Android

Guys, I am new to Graphhopper. I was trying to compile Graphhopper using android studio for API 23. It failed to resolve AWT specific imports e.g. java.awt.image.raster etc. After some browsing, it looks like Android doesn’t support AWT. In that case, how to resolve Graphhopper AWT dependencies for Android? Can you please help me out?

See here for instructions regarding GraphHopper use within an IDE.

Compiling GraphHopper can be done via Maven and Eclipse, IntelliJ, NetBeans, etc.

Android Studio can be used for opening the Android sample via Gradle.

Please keep in mind our Code of Conduct and avoid talking just to men (“Guys”)

Oops. Noted :slight_smile: Sorry abt that.

1 Like

Thank you. I am able to successfully compile the graphhopper library using maven.

On default compilation of Graphhopper sample android App, which loads ‘graphhopper-core-0.8-SNAPSHOT.jar’ online from repo, everything works great.

But when i try to use my locally compiled version of graphhopper-core-0.8-SNAPSHOT.jar file, the same APP with the same Map data throws following error:
" An error happened while creating graph:Failed resolution of: Lgnu/trove/list/array/TIntArrayList;"

What can be the problem here?

You have modified the app’s gradle file?
If you use jars or don’t use Gradle transitive dependencies then you need to add the GraphHopper requirements:

compile 'net.sf.trove4j:trove4j:3.0.3'
compile 'org.slf4j:slf4j-api:1.7.21'

Also your favorite SLF4J binding.

Thanks a ton :slight_smile: I was missing on trove4j dependency. Cheers.