question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building Android package via maven fails

See original GitHub issue

It seems that since the update to mapsforge/vtm 0.8.0 we can no longer build the Android demo (at least via maven). The problem is the class clash of two different jts jars: one older 1.13 (from gh-core) and the 1.14 jts-core from mapsforge vtm-jts - see this change.

The cleanest way would be to upgrade to 1.14 for gh-core. @michaz what blocking issues are there to do so? I remember it was GeoJSON related but as mapsforge does also related stuff - maybe @devemux86 can help?

  • fix dep problem or workaround the issue for now via some dep exclusion
  • the NetBeans graph dependency viewer shows a clash for slf4j-api: 1.7.12 vs. 1.7.21 … In GH we usually use 1.7.25 and now there is also a more recent slf4j-android so we should be able to update this.

BTW: The error message when executing mvn -P include-android -DskipTests=true clean install was a bit cryptic:

[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.4.3:dex (default-dex) on project graphhopper-android: : MojoExecutionException: ANDROID-040-001: Could not execute: Command = ...

Executing the listed command showed me the problem:

Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/vividsolutions/jts/JTSVersion;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/vividsolutions/jts/algorithm/Angle;
...

Excluding one or the other jts library does not fix the problem or causes others.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:23 (23 by maintainers)

github_iconTop GitHub Comments

2reactions
karussellcommented, Aug 24, 2017

Thanks!

It looks like 1.15 is around the corner (see slide 5 here) and if that will be the case I’ll ask/help those dependencies to upgrade so we reduce potential license problems when using GH in iOS or Android (due to the LGPL).

1reaction
devemux86commented, Feb 15, 2018

My local builds work, can you try:

implementation('org.mapsforge:vtm-jts:0.9.2') {
    exclude group: 'com.vividsolutions', module: 'jts'
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio-Build Failed - maven - Stack Overflow
I don't know where it comes from, I work behind a proxy, but I configured it well: the test connection in android studio...
Read more >
Configure your build - Android Developers
Note: Because Gradle and the Android Gradle plugin run independently from Android Studio, you need to update the build tools separately. Read the...
Read more >
How to add maven library in new Android Studio 2022 ...
In the New Android Studio(Chipmunk | Bumblebee ) file strucure changed a bit, so in order to add the maven library we have...
Read more >
IntelliJ IDEA - Troubleshooting common Maven issues
If you received the OutOfMemory error, try to increase the heap size for the Maven importer. In the Settings/Preferences dialog ( Ctrl+Alt+S ),...
Read more >
Maven and Gradle support for Java in Visual Studio Code
Right-click on a target folder and select Create Maven Project. Gradle. VS Code supports Gradle Java project (not including Android) via the Gradle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found