-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapsforge 0.9.0: Android dex error (mapsforge-map-android-extras) #1020
Comments
I can just confirm that this error happens when changing from 0.8.0 to
0.9.0 and no other change in the project.
Not sure what causes this.
…On 8 December 2017 at 14:07, Dominic Schaff ***@***.***> wrote:
I have been using maps forge 0.8.0 with great success but when updating to
0.9.0 I am unable to compile the project anymore. I am unsure what I have
done wrong.
I am compiling for SDK 26 with build tools 26.0.2, using Android Studio 3
My minimum SDK is version 16 and target is 25
The dependancies I have for the maps are:
dependencies {
compile project(":mrd-mobile-shared")
compile 'org.mapsforge:mapsforge-map-android:0.8.0'
compile 'com.caverock:androidsvg:1.2.2-beta-1'
compile 'org.mapsforge:mapsforge-themes:0.8.0'
compile('org.mapsforge:mapsforge-map-android-extras:0.8.0') {
transitive = false
}
}
Other dependancies are:
dependencies {
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.amazonaws:aws-android-sdk-core:2.6.9'
compile 'com.amazonaws:aws-android-sdk-cognito:2.6.9'
compile 'com.amazonaws:aws-android-sdk-sqs:2.6.9'
compile 'com.amazonaws:aws-android-sdk-s3:2.6.9'
compile 'com.joshdholtz.sentry:sentry-android:1.6.2'
compile 'com.koushikdutta.ion:ion:2.2.1'
compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.5.0'
}
But as soon as I update to 0.9.0 (and try run on a device) I get a compile
error:
Error:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDevelopmentDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1020>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJJMOcAlQd4DvqAk5Ny0_vvU2s6qe_Wiks5s-NIOgaJpZM4Q6o6X>
.
|
I have noticed that even if I use less of the maps dependancies and only use the themes and android-extras I still get the same error (and the transitive bit doesn't seem to make much difference). |
Try to update the build-tools. I had a similar problem with another library. Just a try … |
Has been noted that new Android Studio 3 / Gradle 4 / Android plugin 3 behave a bit strange in dependencies, regarding run configurations. Please use the latest Android build tools like officially recommended and avoid deprecated calls, e.g. For example in apps with many dependencies, like the GraphHopper Android sample which I maintain and uses also Mapsforge/VTM libraries. |
I will try the recommendations and comment here what the result is |
I updated the build tools version to 27.0.2 (which is the latest according to the SDK tools)
I then cleaned my build, but I am getting the same issue. And as soon as I change back to 0.8.0 issue goes away. So I have managed to get the issue down to just maps forge libraries. Also I cannot enable the minify, as soon as I do that the app does not compile, but that is related to some other libraries I am using. |
Can you try with all Mapsforge required dependencies, as mentioned in integration guide? BTW internet and Stack Overflow are full of questions for latest Android Studio and "Unable to merge dex" issues. Some recommend |
I now have it working again. Thanks @devemux86 I added all the dependancies from "Core" and "Android" Now it is working again. |
So I am assuming one of the dependancies may have moved or something. But it is working so I am happy. Thanks for the quick responses |
That module doesn't even belong in Mapsforge, since handling permissions is clearly app's (not library's) responsibility and can be done with too many more intuitive ways. |
I removed the extras package, as it seems I had stopped using it at some point. Also I am not sure what I was using it for either. |
I contains code for handling (some) runtime permissions, since Android 6.0 (API 23). |
I handle the permissions elsewhere, as I use them in the app. Which is probably why I stopped using them |
I have been using maps forge 0.8.0 with great success but when updating to 0.9.0 I am unable to compile the project anymore. I am unsure what I have done wrong.
I am compiling for SDK 26 with build tools 26.0.2, using Android Studio 3
My minimum SDK is version 16 and target is 25
The dependancies I have for the maps are:
Other dependancies are:
But as soon as I update to 0.9.0 (and try run on a device) I get a compile error:
Error:
The text was updated successfully, but these errors were encountered: