Дубликаты ошибок класса Hamcrest при добавлении зависимости времени выполнения от Json-SimpleAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Дубликаты ошибок класса Hamcrest при добавлении зависимости времени выполнения от Json-Simple

Сообщение Anonymous »

Я использую последнюю стабильную версию Android Studio (Otter 2), и зависимости моей библиотеки не сообщают о каких-либо новых доступных версиях.
Я пишу класс, который будет анализировать объекты JSON с жизнью в библиотечном модуле, который будет использоваться как в этом приложении для Android, так и на сервере в Джакарте. Поэтому я выбрал com.googlecode.json-simple:json-simple в качестве библиотеки анализатора JSON.
При добавлении этой библиотеки возникает ряд ошибок класса dupl;icate, связанных с библиотекой hamcrest-core-1.1.jar (см. ниже). Удаление моей библиотеки и добавление зависимости runtimeOnly к библиотеке json-simple также приводит к ошибкам.
После поиска в Google я нашел ряд предложений в теме:
configurations {
compile.exclude group: "junit", module: "junit"
}

Куполу, которому исполнилось 10 лет. Либо они не устранили проблему (добавил ли я предложение в блоке android или на верхнем уровне), либо синтаксически они потерпели неудачу. Так что мне либо не хватает чего-то простого, либо они не работают для версии Gradle, которую я использую (8.13).
Как всегда, благодарю за любые предложения.
Дубликаты ошибок:
Duplicate class org.hamcrest.BaseDescription found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.BaseMatcher found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.CoreMatchers found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.Description found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.Factory found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.Matcher found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.SelfDescribing found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.StringDescription found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.AllOf found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.AnyOf found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.DescribedAs found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.Is found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsAnything found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsEqual found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsInstanceOf found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsNot found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsNull found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsSame found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.internal.ArrayIterator found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.internal.SelfDescribingValue found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)
Duplicate class org.hamcrest.internal.SelfDescribingValueIterator found in modules hamcrest-core-1.1.jar -> hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar -> junit-4.10 (junit:junit:4.10)


Подробнее здесь: https://stackoverflow.com/questions/798 ... mple-added
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»