Build failed after adding google cloud storage dependency android - android

I am added google cloud dependency by
implementation ('com.google.cloud:google-cloud-storage:1.12.0'){
exclude group: 'com.google.guava'
}
but my build is failed with the following error
Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- auto-value-1.2.jar (com.google.auto.value:auto-value:1.2)
I tried by disabling annotation processor
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/project.properties'
}
.................
.........
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
........................
I am getting following error
More than one file was found with OS independent path 'project.properties'

Add this part as dependencies:
compileOnly 'com.google.auto.value:auto-value:1.5.1'
annotationProcessor 'com.google.auto.value:auto-value:1.5.1'

Related

How to resolve Duplicate files copied in APK META-INF/rxjava.properties

I am using rxjava and rxvolley on my android aplication. When I try to run it I get this error
Execution failed for task ':testapp:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
File1: C:\Users\Daniel\.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.1.0\748f0546d5c3c27f1aef07270ffea0c45f0c42a4\rxjava-1.1.0.jar
File2: C:\Users\Daniel\.gradle\caches\modules-2\files-2.1\io.reactivex.rxjava2\rxjava\2.0.3\d2f725668bd22e21170381b23f8fbdf72c69d886\rxjava-2.0.3.jar
I have a exclude.gradle file like this
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/rxjava.PROPERTIES'
exclude 'META-INF/RXJAVA.properties'
exclude 'META-INF/RXJAVA.PROPERTIES'
exclude 'META-INF/rxjava'
exclude 'META-INF/RXJAVA'
}
lintOptions {
abortOnError false
}
}
How can I fix this problem?
I had the same problem. The way I fixed it is adding the packagingOptions in app gradle as described in Duplicated file rxjava.properties
android {
defaultConfig {
}
buildTypes {
}
packagingOptions{
exclude 'META-INF/rxjava.properties'
}
}
I had the same issue.
In my case I am using Retrofit2 but I assume that the issue is with the rx libraries
This is the build.gradle (module:app) I am using and in my case works.
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'io.reactivex:rxandroid:1.1.0' //<-use this
compile 'io.reactivex:rxjava:1.1.3' //<-use this
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
Anyway there is one better solution as you can see on the top
I also have the same problem but easily removed duplicated "comment" all Rxjava related dependencies that it doesn't use in my code.
//RxJava removes or comment duplicated and not used dependencies.
// implementation 'com.squareup.retrofit2:adapter-rxjava:2.4.0'
// implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
// implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
I encountered the same issue and fixed it by putting below code in app/build.gradle file. Please note that you have to put '*' at the end of path to exclude all the files inside the folder. You will have to change the path of files to be excluded in the below code based on error description.
compileSdkVersion 25
buildToolsVersion "24.0.3"
packagingOptions {
exclude 'com/google/appengine/repackaged/org/apache/commons/codec/language/bm/*'
exclude 'com/google/appengine/repackaged/org/codehaus/jackson/impl/*'
exclude 'com/google/appengine/repackaged/org/apache/commons/codec/language/*'
}
I had this issue today and fixed this problem
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
//RxJava dependencies
compile 'io.reactivex.rxjava2:rxandroid:2.0.0'
compile 'io.reactivex.rxjava2:rxjava:2.0.2'
compile 'org.reactivestreams:reactive-streams:1.0.0'
I also have this problem ,I also used the same method as you ,but because I hava two module ,I only chang it in the module which dependency Rxjava,Finally I I fixed it is adding the packaginOptions in app gradle
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
If you are facing this issue in 2019 and above this is most probably because you are using the deprecated RxJava 2 CallAdapter.Factory ie
com.jakewharton.retrofit:retrofit2-rxjava2-adapter
you will have to remove that dependency and add this
implementation 'com.squareup.retrofit2:adapter-rxjava2:latest.version'
please get the latest version from here
Add this code in build.gradle.app
android {
...
...
...
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}

Running Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'

Running Error Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
So I'm continuously receiving a gradle build error upon trying to run my project. I have searched for other solutions and some say that adding:
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE' // will not include LICENSE file
// as noted by #Vishnuvathsan you may also need to include
// variations on the file name. It depends on your dependencies.
// Some other common variations on notice and license file names
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
}
But it doesn't work for me.The Error as below:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
**File1: E:\Workspace_Android\TravelStory\app\build\intermediates\exploded-aar\cn.bmob.android\bmob-sdk\3.5.0\jars\classes.jar
File2: C:\Users\Prometheus\.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.2.1\4e4cfa4adc74521d5966799fa5ab70b733552f68\rxjava-1.2.1.jar**
I try to delete the File2 but after compile/gradle the file created again.
studio version is 2.2.3
gradle version is 2.2.3
My gradle file content as below:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.travelstory.travelstory"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true;
}
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE' // will not include LICENSE file
// as noted by #Vishnuvathsan you may also need to include
// variations on the file name. It depends on your dependencies.
// Some other common variations on notice and license file names
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:multidex:1.0.1'
//屏幕自动适配
compile 'com.zhy:autolayout:1.4.5'
//注解框架
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
//6.0权限rx
compile 'com.tbruyelle.rxpermissions:rxpermissions:0.9.1#aar'
//RxJava RxLifecycle生命周期管理
compile 'com.trello:rxlifecycle:1.0'
compile 'com.trello:rxlifecycle-components:1.0'
//3.5.0:请务必查看下面注释[1]
compile ('cn.bmob.android:bmob-sdk:3.5.0')
// {
// exclude group: 'io.reactivex:rxjava:1.1.6'
// }
//如果你想应用能够兼容Android6.0,请添加此依赖(org.apache.http.legacy.jar)
compile 'cn.bmob.android:http-legacy:1.0'
//bmob-push:Bmob的推送包
compile 'cn.bmob.android:bmob-push:0.8'
//多fragment多模块Activity
compile 'me.yokeyword:fragmentation:0.9.3'
// 如果想使用SwipeBack 滑动边缘退出Fragment/Activity功能,请再添加下面的库
compile 'me.yokeyword:fragmentation-swipeback:0.7.9'
}
Your not excluding the file the error is warning about.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
Here the complaint is META-INF/rxjava.properties so just update your packageOptions block to exclude this file explicitly.
packagingOptions {
exclude 'META-INF/rxjava.properties'
// ... and any other excludes go here
}
Update your gradle with this code:
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
}
This happens when there is a duplication of libraries

"Duplicate lib file copied in APK-META-INF/license.txt " error in Android Studio

I am using below 2 lib's in project
1. spring-core-3.1.0.RELEASE.jar
2. spring-web-3.1.0.RELEASE.jar
But android studio is considering duplicate entry for above lib's and giving error while packaging.
Error:duplicate files during packaging of APK E:\Code\iDoc\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/license.txt
Origin 1: E:\Code\iDoc\app\libs\spring-core-3.1.0.RELEASE.jar
Origin 2: E:\Code\iDoc\app\libs\spring-web-3.1.0.RELEASE.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'META-INF/license.txt'
}
}
------------------------------------------------------------
Anybody faced similar problem ?
Please suggest some-work around for this error.
Go to your build.gradle file and add the following line:
packagingOptions {
exclude 'META-INF/license.txt'
}
In my case I had to add like this one:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library:1.0.15'
compile 'com.google.code.gson:gson:2.2.4'
compile "org.apache.httpcomponents:httpcore:4.4.1"
compile "org.apache.httpcomponents:httpmime:4.3.6"
}
Note:
Meta-files doesn't affect any programmatic functions of application. Meta files basically contains Textual information like legal-notice, Licences etc of open sources libraries. Excluding it will not affect any thing.
When we use multiple 3rd party open source libraries, sometimes 2 or more projects has same named text files (Example: License.txt or Notice.txt or dependencies.txt). That causes the conflict during build time. In that moment our mighty android studio suggest us to exclude those conflicting meta files.
Important: When excluding the files note that it is case sensitive
I added this to my gradle and it was not working:
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
I was gettting error:
Duplicate files copied in APK META-INF/notice.txt
So the fix is to add META-INF/notice.txt :
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
}
I have most simple solution for txt files. If you remove all txt files in the dependency.
Only add this block.
packagingOptions {
exclude '**/*.txt'
}

Duplicate files during packaging of APK app-debug-unaligned.apk

I got this error Duplicate files during packaging of APK app-debug-unaligned.apk when put 2 jar files :
httpclient-4.3.5.jar
httpmime-4.3.5.jar
into the libs folder after Sync with Gradle and Run.
If user 1 jar file - httpmime-4.3.5.jar, I will not get this error.
Please help me how to avoid this error & still can use 2 jar files in above also,
Thanks,
p/s : I use Android Studio version 0.8.6.
Error Detail
Error:duplicate files during packaging of APK
...\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/DEPENDENCIES
Origin 1: ...\app\libs\httpclient-4.3.5.jar
Origin 2: ...\app\libs\httpmime-4.3.5.jar
build.gradle
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
defaultConfig {
applicationId 'com.app'
minSdkVersion 9
targetSdkVersion 20
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:20.0.0'
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.google.android.gms:play-services:5.2.08'
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile 'de.hdodenhof:circleimageview:1.2.0'
compile files('libs/httpmime-4.3.5.jar')
}
UPDATE I changed from compile files('libs/httpmime-4.3.5.jar') to use Maven Link. I got same error again after put 2 maven link together:
compile 'org.apache.httpcomponents:httpmime:4.4-alpha1'
compile 'org.apache.httpcomponents:httpcore:4.4-alpha1'
This is the warning
Warning:Dependency org.apache.httpcomponents:httpclient:4.4-alpha1 is
ignored for debug as it may be conflicting with the internal version
provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency
org.apache.httpcomponents:httpclient:4.4-alpha1 is ignored for release
as it may be conflicting with the internal version provided by
Android.
In case of problem, please repackage it with jar to change the class packages
Please help me fix.
SOULITION I know good answer now by addding these lines will fix Duplicate files error :
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
You can replace compile files('libs/httpmime-4.3.5.jar') with this compile 'org.apache.httpcomponents:httpmime:4.3.5'.
Also you are duplicating the dependencies compile fileTree(include: ['*.jar'], dir: 'libs') already includes compile files('libs/httpmime-4.3.5.jar')
update your build.gradle and add the following lines
android{
.
.
.
packagingOptions {
exclude 'META-INF/license.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/NOTICE'
}
}
this will fix this error. I got the same error, doing this fixed it.
Please update this to your build.gradle file.
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
I updated gradle now it's working
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
add the below code to dependencies
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
compile (group: 'org.apache.httpcomponents' , name: 'httpmime' , version: '4.3.5') {
exclude module: 'org.apache.httpcomponents:httpclient'
}
now if you run that it will show you why it is telling duplicate may be because of META-INF/NOTICE, META-INF/LICENSE, add that first again run it may show other type.
add all like below under android section
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
definitely it will solve your problem.
remove all the dependancy file from the system before build.

Android Studio 0.4 Duplicate files copied in APK META-INF/LICENSE.txt

After I have updated my Studio from 0.3.7 to 0.4.0, I can't compile my project. I found a solution on stackoverflow: Duplicate files copied (Android Studio 0.4.0)
I updated my project to gradle 0.7.+, but I don't know where I must put the next strings:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
My logcat: log
Execution failed for task ':Prog:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar
File 2: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar
P.S. Develop in ubuntu 13.04
Putting the dependecies at the top and the packageOptions at the end worked for me.
apply plugin: 'android'.
Here is my full build.gradle at the app folder.
dependencies {
compile 'com.android.support:support-v4:+'
compile files('libs/apache-mime4j-0.6.jar')
compile files('libs/httpmime-4.0.jar')
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 10
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.txt'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
EDIT: Almost all OS licence include the obligation to "include a copy of the licence" into your project. So this means, that you have to include a copy of all OS licences you use into you projects. By "excluding" them in gradle, you violate the licences.
Excluding them from the project might not be the best option.
Thank you R.S. for the info.
Attention!! Possible OpenSource license violation.
With excluding license.txt files as proposed above you may violate some opensource licenses as it is a common point in opensource licences to agree to add it to your source.
Better check your opensource licences.
Update:
Until there is a better solution, use
packagingOptions {
pickFirst 'META-INF/license.txt'
}
like this you at least fulfill a part of the license obligation
You also can try:
packagingOptions {
merge 'META-INF/license.txt'
}
just add
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
in build.gradle
You can fix it by adding the following code to project/app/build.gradle:
android {
// Fixed build error : Duplicate files copied in APK META-INF/xxx
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
}
I was facing the same problem as per new version of gradle, Below build.gradle text format work for me :
There are two jackson jars in my libs folder.
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.omtlab.myapplication"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'libs/jackson-core-asl-1.9.13.jar'
exclude 'libs/jackson-mapper-asl-1.9.13.jar'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
dependencies {
//compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
compile files('libs/jackson-core-asl-1.9.13.jar')
compile files('libs/jackson-mapper-asl-1.9.13.jar')
}
Adding:
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
worked for me, biniam_Ethiopia's solution is probably the most fail-safe
While inserting this code
android{
packagingOptions{
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
}
}
MAKE SURE if in error it is showing
> Duplicate files copied in APK META-INF/LICENSE.txt
then add
android{
packagingOptions{
exclude 'META-INF/LICENSE.txt'
}
}
if in error it is showing
> Duplicate files copied in APK META-INF/LICENSE
then add
android{
packagingOptions{
exclude 'META-INF/LICENSE'
}
}
if in error it is showing
> Duplicate files copied in APK META-INF/license.txt
then add
android{
packagingOptions{
exclude 'META-INF/license.txt'
}
}
In short text CASE and document FORMAT(.txt) is so important.
(this error exist in Android Studio 1.1.0 also)
This will help you solve the problem
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
Add in build.gradle file and syn project
I just add 2:
android{
packagingOptions{
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
}
}
This may very well be bad practice, however if you are including multiple large libraries, you may find yourself working through hundreds of these kinds of conflicts.
Listed below is a super-simple fix for such cases:
android {
....
packagingOptions {
// Allow the compilation process to choose the dependencies for us.
pickFirst "**"
}
}
I had a similar error and solved it without the packingOptions() and exclude function. I was adding two dependencies but one was a sub-group of the first. This caused the error, once I removed one of them I got a clean build. I recommend checking for a similar error within your dependency block.
When using java-jwt and jackson-core together use following:
exclude("META-INF/maven/com.fasterxml.jackson.core/jackson-annotations/pom.properties")
exclude("META-INF/maven/com.fasterxml.jackson.core/jackson-annotations/pom.xml")
exclude("META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.properties")
exclude("META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.xml")
exclude("META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.properties")
exclude("META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml")

Categories

Resources