Skip to content
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

Duplicate class SafeThrowable or StackTraceWriter #11

Closed
franck-serot opened this issue Oct 27, 2020 · 3 comments
Closed

Duplicate class SafeThrowable or StackTraceWriter #11

franck-serot opened this issue Oct 27, 2020 · 3 comments

Comments

@franck-serot
Copy link

Hi
I tried to use the jDSP 0.5.0 library in an Android projet.
I added the dependencies :
implementation('com.github.psambit9791:jdsp:0.5.0')
But I had the following error :

Duplicate class org.apache.maven.surefire.report.SafeThrowable found in modules 
jetified-common-java5-2.19.1 (org.apache.maven.surefire:common-java5:2.19.1) and 
jetified-surefire-api-2.19.1 (org.apache.maven.surefire:surefire-api:2.19.1)
Duplicate class org.apache.maven.surefire.report.StackTraceWriter found in modules 
jetified-common-java5-2.19.1 (org.apache.maven.surefire:common-java5:2.19.1) and
jetified-surefire-api-2.19.1 (org.apache.maven.surefire:surefire-api:2.19.1)

I tried to exclude the dependencies with the following gradle configurations :

    implementation('com.github.psambit9791:jdsp:0.5.0') {
        exclude group: 'org.apache.maven.surefire', module: 'common-java5'
    }

or

    implementation('com.github.psambit9791:jdsp:0.5.0') {
        exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
    }

But I add the following error :

Execution failed for task ':mylibrary:mergeDebugAndroidTestJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'META-INF/DEPENDENCIES'.

Could you please help me to solve this problem ?
Best regards,
Franck

@psambit9791
Copy link
Owner

Refer to issue #5

@franck-serot
Copy link
Author

I tried to exclude the dependencies with the following gradle configurations :

implementation('com.github.psambit9791:jdsp:0.5.0') {
        exclude group: 'org.apache.maven.surefire', module: 'common-java5'
        exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
    }

But I add the following error :

Execution failed for task ':mylibrary:mergeDebugAndroidTestJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'META-INF/DEPENDENCIES'.

I need to evaluate the jDSP library with AndroidTest module.
Could you please help me to solve this problem ?
Best regards,
Franck

@franck-serot
Copy link
Author

I found the solution.
In the gradle file, add the following configuration in the android section :

packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE.md'
        exclude 'META-INF/LICENSE-notice.md'
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants