JavaMoney / jsr354-ri

JSR 354 - Moneta: Reference Implementation
Other
344 stars 101 forks source link

DuplicateRelativeFileException when importing library in Android Studio #394

Closed slaviboy closed 10 months ago

slaviboy commented 1 year ago

When I try to import this Java library in Android Studio

implementation("org.javamoney:moneta:1.4.2")

I get the following error:

com.android.builder.merge.DuplicateRelativeFileException: 3 files found with path 'javamoney.properties' from inputs:

 - C:\Users\Slaviboy\.gradle\caches\modules-2\files-2.1\com.github.JavaMoney.jsr354-ri\moneta-convert-ecb\1.4.2\cd734dec35de5693e50836af4787c5a876bec42c\moneta-convert-ecb-1.4.2.jar
 - C:\Users\Slaviboy\.gradle\caches\modules-2\files-2.1\com.github.JavaMoney.jsr354-ri\moneta-convert-imf\1.4.2\8e4775e5bd2328a0accef2c8fd5ff469b457e1be\moneta-convert-imf-1.4.2.jar
 - C:\Users\Slaviboy\.gradle\caches\modules-2\files-2.1\com.github.JavaMoney.jsr354-ri\moneta-core\1.4.2\7ec7364585dc47278dea9f5787390dec0a456f\moneta-core-1.4.2.jar

Is it possible to include and use this library with Android Studio?

slaviboy commented 1 year ago

Fix it by importing:

implementation("org.javamoney:moneta:1.1")
slaviboy commented 1 year ago

@keilw Will it be possible to make, latest version 1.4.2 supported by Android Studio projects?

keilw commented 1 year ago

@slaviboy 1.1 is quite old, I cannot promise any changes to the properties, because one aspect is overloading them in sub-modules.

keilw commented 10 months ago

@slaviboy You should be able to do this by excluding certain artifacts in Gradle: https://discuss.gradle.org/t/how-can-i-declare-an-exclusion-on-my-source-folder/22821/4 or https://stackoverflow.com/questions/53394850/exclude-file-from-jar-using-gradle