is there another solution for the "Multiple dex files define Landroid/support/annotation/AnimRes" error using Facebook SDK for android, besides excluding group: 'com.android.support', module: 'support-v4'4 in build.graddle?
When I do this, another SDK, for another service that I use, fails and shows me: "error inflating class android.support.v7.internal.widget.actionbaroverlaylayout"
So, can somebody point me to another workaround so I don't have to exclude group: 'com.android.support', module: 'support-v4' and that way I can use another SDK that I need too.
Have you tried this solution? Otherwise try the most voted one of that thread, this must be your solution for sure.
Related
I recently added implementation 'com.google.android.play:core:1.6.4' as a dependency in my android project and now Intellij is complaining that Program type already present: androidx.exifinterface.R. What does this mean and how do I fix this?
Note: this is meant to be a Q&A question. I've already found a solution and I want to share with others.
I recently ran into an issue where android studio would complain that Program type already present: androidx.exifinterface.R. This happened after adding the implementation 'com.google.android.play:core:1.6.4' dependency. I had stumbled on this before with androidx.asynclayoutinflater.R. I've found the that adding something like the following to your module level gradle file will fix it:
configurations.all {
// This is from a previous, similar issue
exclude group: "androidx.asynclayoutinflater", module: "asynclayoutinflater"
// This is the LOC that fixed the issue in this post
exclude group: "androidx.exifinterface", module: "exifinterface"
}
The pattern seems to be:
if there's a complaint about androidx.MODULE_X.R already being present
then add
exclude group: "androidx.MODULE_X", module: "MODULE_X"
to configurations.all in module level gradle file
This worked for both asynclayoutinflater and now exifinterface. I don't know if the pattern scales but so far it has worked. My understanding of the underlying issue is that two dependencies in the module dependency graph (eg com.google.android.play:core) explicitly include the problematic module (eg exifinterface) and so we need to exlude one of those explicit dependencies. My understanding might be wrong.
I am building a small Android app with Kotlin and Android Studio. Everything worked fine, but out of the blue (at least what seems to me), I am stuck with
Error:Execution failed for task :bahndb:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest'.
> com.android.builder.dexing.DexArchiveMergerException:
Error while merging dex archives:
C:\Users\Dieter\AndroidStudioProjects\zuegliwidget\bahndb\build\intermediates\transforms\dexBuilder\androidTest\debug\13.jar,
and so on until 47.jar when I try to run an Instrumented Test. Local tests all work ok. It is strange that even earlier checkout that had worked before show this behaviour (some update? I have reinstalled Android Studio twice)
I have read all message on the subject here, none helped:
Use clean build (I do every time)
Invalidate cache (over and over)
added multiDex
Tried different Kotlin plugins
Uninstalled 3.1 Canary 5, installed stable, reinstalled canary 5
Un/commented dependencies one after the other (this had worked earlier)
Running Lint, but failed with error
App has 2 submodules, bahndb and http. Here are the gradle files, if it matters
https://github.com/dmenne/zuegliwidget/blob/master/build.gradle
https://github.com/dmenne/zuegliwidget/blob/master/app/build.gradle
https://github.com/dmenne/zuegliwidget/blob/master/bahndb/build.gradle << Most likely guilty
https://github.com/dmenne/zuegliwidget/blob/master/http/build.gradle
Is there a systematic approach to locate the source of the problem
Thanks to #CommonsWare's comments, I found that I had
implementation ('com.squareup.retrofit2:converter-simplexml:2.3.0'){
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'stax', module: 'stax-api'
exclude group: 'stax', module: 'stax'
}
in one submodule, but had forgotten the exclude-part in the other.
I am Developing an android application and using a library say A. and I have another library say B which internally uses A. Because of this, I get Duplicate zip entry error on my build. How do i exclude libraries from 3rd party libraries or how do i get around this issue?
You can exclude the modules you don't need from a dependency with exclude module:
compile (project(':B')) {
exclude module: 'A'
}
i'm having the following issue on building an Android Cordova.
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
The problem only happens when i use Wizcorp/Facebook with AdMob-Pro.
You need to exclude android-support-v4.jar that got included by Wizcorp Facebook plugin. Trick is simple you need to create build-extras.gradle inside platforms/android and add following:
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
the solution is in this post, but doesn't work in my case.
#mladen5 solution, not mine.
When I was trying to use Android Studio to debug my project, I got the following error,
Class com.google.ads.AdRequest.Gender has already been added to output. Please remove duplicate copies.
The cause seems to be that the google play services lib and another lib used by my project both contain the com.google.ads.AdRequest.Gender class, and I don't think I can remove it from either one.
Does anyone know how to fix this problem?
Thanks a lot.
I tried the following statement in build.gradle in order to exclude the duplicated classes in the google play services lib, but it still does not solve the problem.
compile ('com.google.android.gms:play-services:4.1.32') {
exclude group: 'com.google.ads'
}
You can try using Gradle's exclude mechanism when setting up the DatawindAdsSdk-2.0 dependency. There are docs available, but it will probably look something like this:
dependencies {
compile files('libs/datawindAdsSdk-2.0.jar') {
exclude group: 'com.google.ads'
}
}
experiment with that and see if you can get it working.
But I came to this post via google and I read this post has the same problem as me. I solved it excluding the group and the whole library. In my case the problem was with an animatorListener.
compile ('com.rengwuxian.materialedittext:library:1.8.2'){
exclude group: 'com.nineoldandroids', module: 'library'
}
This is my post duplicate library gradle animatorlistener duplicate