You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Switching to vtm 0.7.0 did not fix the error. Switching to 0.6.0 causes some other cryptic error
message: Uncaught translation error: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
Still failing after setting platform to 26 and updating the maven android plugin to 4.5.0. Now I'm confused. Do I really have to setup the Android SDK from scratch everytime there is a problem :( ?
Hmm indeed the build command fails, though the Sample work fine and can run!
FYI
My use on Gradle is to always disable transitive dependencies, wanting to have complete control of what gets in the apps (Android or Desktop).
Doing so with VTM + GraphHopper libs, I have to explicitly declare JTS dependency and works with both 1.13 and 1.14.
So I suppose here Maven still manages somehow to get JTS from some library?
Hmm indeed the build command fails, though the Sample work fine and can run!
How do you normally produce an apk with gradle? Or do you mean that just the sample started via gradle or IntelliJ works fine?
So I suppose here Maven still manages somehow to get JTS from some library?
I think the clash comes from the different versions of graphhopper-core vs. vtm-jts. There is no other jts involved. But even if I exclude one or the other it does not work.
BTW how do you build Android apps with Maven, with maven-android-sdk-deployer?
Normally, yes. But I'm open to switch to gradle for the Android demo.
I prefer the 3rd method in development, to clearly see what dependencies each lib introduces.
But since VTM doesn't have issues with JTS 1.13, can use the 1st solution in GraphHopper sample?
Well I recommend to not keep Sample on old Android versions.
The tools advance for a reason, also fixing things besides improvements, so trying to solve issues with old versions only consumes our time? 🙂
That's very strange, working with 26.0.1 from its start without issues..
Of course with all environment aligned, Android Studio 2.3.3, Gradle 3.3, Android plugin 2.3.3, Android SDK 26 (fully updated), etc.
The issue is that two other dependencies (gtfs-lib, and, more importantly, the Jackson bindings for JTS) declare JTS 1.13, which in itself is not a problem, but they switched from one jar to several jars between them (jts -> jts-core, ... ), which means that Maven doesn't know that one supersedes the other.
So I updated to jts-core 1.14.0 now and manually excluded the monolithic JTS from the dependencies.
This means that only tests can prevent ClassNotFoundExceptions in case one of the dependencies tries to use something which is in jts but not in jts-core. :-}
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).
Activity
karussell commentedon Aug 23, 2017
Switching to vtm 0.7.0 did not fix the error. Switching to 0.6.0 causes some other cryptic error
message:
Uncaught translation error: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26Still failing after setting platform to 26 and updating the maven android plugin to 4.5.0. Now I'm confused. Do I really have to setup the Android SDK from scratch everytime there is a problem :( ?
karussell commentedon Aug 23, 2017
Reinstalling the android-sdk didn't help.
karussell commentedon Aug 23, 2017
When executing
./gradlew buildI get the same error about the SimException and min sdk version.devemux86 commentedon Aug 23, 2017
Hmm indeed the build command fails, though the Sample work fine and can run!
FYI
My use on Gradle is to always disable transitive dependencies, wanting to have complete control of what gets in the apps (Android or Desktop).
Doing so with VTM + GraphHopper libs, I have to explicitly declare JTS dependency and works with both 1.13 and 1.14.
So I suppose here Maven still manages somehow to get JTS from some library?
BTW how do you build Android apps with Maven, with maven-android-sdk-deployer?
karussell commentedon Aug 23, 2017
How do you normally produce an apk with gradle? Or do you mean that just the sample started via gradle or IntelliJ works fine?
I think the clash comes from the different versions of graphhopper-core vs. vtm-jts. There is no other jts involved. But even if I exclude one or the other it does not work.
Normally, yes. But I'm open to switch to gradle for the Android demo.
devemux86 commentedon Aug 23, 2017
I meant that the Sample "runs" via Android Studio in the emulator or in the device.
When perform a Gradle build, then we see the issue.
So I tested all ways and run + build can work with everyone:
and
compile 'com.vividsolutions:jts:1.13'or
compile 'com.vividsolutions:jts-core:1.14.0'devemux86 commentedon Aug 23, 2017
I prefer the 3rd method in development, to clearly see what dependencies each lib introduces.
But since VTM doesn't have issues with JTS 1.13, can use the 1st solution in GraphHopper sample?
karussell commentedon Aug 24, 2017
Thanks! (For the moment I would also use the 1st solution)
And finally got it working with gradle and also maven.
A further problem in maven (with the SimException) was due to the latest build tools!? After I did:
sdkmanager --uninstall "build-tools;26.0.0"
sdkmanager --uninstall "build-tools;26.0.1"
The maven stuff worked too! And you see the same SimException problem in gradle when you edit build.gradle and set:
karussell commentedon Aug 24, 2017
Found the solution via the commit after this comment groovy/groovy-android-gradle-plugin#145 (comment)
devemux86 commentedon Aug 24, 2017
Always work with latest Android tools and don't have such issues.
e.g. my tests were with build tools 26.0.1
But didn't send a PR since you told me to not change all the time the Sample when Android advances its versions.
karussell commentedon Aug 24, 2017
This is strange as I installed the android sdk and gradle all from scratch :(
I'll keep the build.gradle then with the 26er version
No problem, will commit the necessary changes also to the pom.xml
karussell commentedon Aug 24, 2017
BTW: the issue remains if I used 26.0.0 ...
2 remaining items
devemux86 commentedon Aug 24, 2017
Well I recommend to not keep Sample on old Android versions.
The tools advance for a reason, also fixing things besides improvements, so trying to solve issues with old versions only consumes our time? 🙂
karussell commentedon Aug 24, 2017
Not sure what you mean :) ... for me it does not work for 26.0.1 and also not for 26.0.0. Only with 25.0.0 I got it build successfully.
devemux86 commentedon Aug 24, 2017
That's very strange, working with 26.0.1 from its start without issues..
Of course with all environment aligned, Android Studio 2.3.3, Gradle 3.3, Android plugin 2.3.3, Android SDK 26 (fully updated), etc.
android: minor dependency improvement after #1144
Switch to jts-core 1.14.0, exclude jts 1.13 from dependencies. #1144
michaz commentedon Aug 24, 2017
The issue is that two other dependencies (gtfs-lib, and, more importantly, the Jackson bindings for JTS) declare JTS 1.13, which in itself is not a problem, but they switched from one jar to several jars between them (jts -> jts-core, ... ), which means that Maven doesn't know that one supersedes the other.
So I updated to jts-core 1.14.0 now and manually excluded the monolithic JTS from the dependencies.
This means that only tests can prevent ClassNotFoundExceptions in case one of the dependencies tries to use something which is in jts but not in jts-core. :-}
But should be fine.
And graphhopper-core gets a bit smaller.
karussell commentedon 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).
karussell commentedon Feb 15, 2018
I'm again getting this problem https://travis-ci.org/graphhopper/graphhopper/jobs/341884687#L1924
@devemux86 is this required? https://github.com/mapsforge/vtm/blob/master/.travis.yml#L20
devemux86 commentedon Feb 15, 2018
VTM Travis config line is for installation of Android platform.
GH Travis error is about (again) mixed dependencies in Android dex process. 🙁
It was fixed at some tools version, let me check that again..
karussell commentedon Feb 15, 2018
Ok, thanks. Excluding helped: https://travis-ci.org/graphhopper/graphhopper/builds/341896715
devemux86 commentedon Feb 15, 2018
My local builds work, can you try:
devemux86 commentedon Feb 15, 2018
BTW I integrated JTS (LocationTech) in VTM lately in mapsforge/vtm#484.
karussell commentedon Feb 15, 2018
Yes, good to know. We have a bit problems with used dependencies: #1039 (comment)
The android build works now. Now I need to enable auto deployment...