Короче говоря
Я не могу получить минимальный и новый Android Studio проект для сборки со следующими добавленными зависимостями:
dependencies {
...
implementation 'com.google.guava:guava:27.0.1-android'
androidTestImplementation "com.google.truth:truth:1.0"
}
Как воспроизвести
Это то, как я это делаю, но есть и другие способы.
- В Android Studio 3.5.2 :
- Файл → Новый → Новый проект ...
- В Диалог создания нового объекта :
- Телефон и планшет * Вкладка 1032 * → Добавить Нет активности → Далее
- Имя , Имя пакета , Сохранить местоположение : Все, что вы хотите
- Язык : Java
- Минимальный уровень API : API 28
- Этот проект будет поддерживать мгновенные приложения : Отключено
- Готово
- В . / App / build.gradle :
- Добавить
implementation 'com.google.guava:guava:27.0.1-android'
и androidTestImplementation "com.google.truth:truth:1.0"
вdependencies
- In ExampleInstrumentedTest.java
- Щелкните правой кнопкой мыши по
class ExampleInstrumentedTest
и выберите Запустить 'ExampleInstrumentedTest'
Ожидается
Тест пройден
Фактический
Ошибка сборки:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugAndroidTestBuild'.
> Could not resolve all task dependencies for configuration ':app:debugAndroidTestRuntimeClasspath'.
> Could not resolve org.checkerframework:checker-compat-qual:{strictly 2.5.2}.
Required by:
project :app
> Cannot find a version of 'org.checkerframework:checker-compat-qual' that satisfies the version constraints:
Dependency path 'sdfsf:app:unspecified' --> 'com.google.truth:truth:1.0' --> 'org.checkerframework:checker-compat-qual:2.5.5'
Constraint path 'sdfsf:app:unspecified' --> 'org.checkerframework:checker-compat-qual:{strictly 2.5.2}' because of the following reason: debugRuntimeClasspath uses version 2.5.2
Dependency path 'sdfsf:app:unspecified' --> 'com.google.guava:guava:27.0.1-android' --> 'org.checkerframework:checker-compat-qual:2.5.2'
> Could not resolve com.google.errorprone:error_prone_annotations:{strictly 2.2.0}.
Required by:
project :app
> Cannot find a version of 'com.google.errorprone:error_prone_annotations' that satisfies the version constraints:
Dependency path 'sdfsf:app:unspecified' --> 'com.google.truth:truth:1.0' --> 'com.google.errorprone:error_prone_annotations:2.3.1'
Constraint path 'sdfsf:app:unspecified' --> 'com.google.errorprone:error_prone_annotations:{strictly 2.2.0}' because of the following reason: debugRuntimeClasspath uses version 2.2.0
Dependency path 'sdfsf:app:unspecified' --> 'com.google.guava:guava:27.0.1-android' --> 'com.google.errorprone:error_prone_annotations:2.2.0'
> Could not resolve org.checkerframework:checker-compat-qual:2.5.5.
Required by:
project :app > com.google.truth:truth:1.0
> Cannot find a version of 'org.checkerframework:checker-compat-qual' that satisfies the version constraints:
Dependency path 'sdfsf:app:unspecified' --> 'com.google.truth:truth:1.0' --> 'org.checkerframework:checker-compat-qual:2.5.5'
Constraint path 'sdfsf:app:unspecified' --> 'org.checkerframework:checker-compat-qual:{strictly 2.5.2}' because of the following reason: debugRuntimeClasspath uses version 2.5.2
Dependency path 'sdfsf:app:unspecified' --> 'com.google.guava:guava:27.0.1-android' --> 'org.checkerframework:checker-compat-qual:2.5.2'
> Could not resolve com.google.errorprone:error_prone_annotations:2.3.1.
Required by:
project :app > com.google.truth:truth:1.0
> Cannot find a version of 'com.google.errorprone:error_prone_annotations' that satisfies the version constraints:
Dependency path 'sdfsf:app:unspecified' --> 'com.google.truth:truth:1.0' --> 'com.google.errorprone:error_prone_annotations:2.3.1'
Constraint path 'sdfsf:app:unspecified' --> 'com.google.errorprone:error_prone_annotations:{strictly 2.2.0}' because of the following reason: debugRuntimeClasspath uses version 2.2.0
Dependency path 'sdfsf:app:unspecified' --> 'com.google.guava:guava:27.0.1-android' --> 'com.google.errorprone:error_prone_annotations:2.2.0'
> Could not resolve org.checkerframework:checker-compat-qual:2.5.2.
Required by:
project :app > com.google.guava:guava:27.0.1-android
> Cannot find a version of 'org.checkerframework:checker-compat-qual' that satisfies the version constraints:
Dependency path 'sdfsf:app:unspecified' --> 'com.google.truth:truth:1.0' --> 'org.checkerframework:checker-compat-qual:2.5.5'
Constraint path 'sdfsf:app:unspecified' --> 'org.checkerframework:checker-compat-qual:{strictly 2.5.2}' because of the following reason: debugRuntimeClasspath uses version 2.5.2
Dependency path 'sdfsf:app:unspecified' --> 'com.google.guava:guava:27.0.1-android' --> 'org.checkerframework:checker-compat-qual:2.5.2'
> Could not resolve com.google.errorprone:error_prone_annotations:2.2.0.
Required by:
project :app > com.google.guava:guava:27.0.1-android
> Cannot find a version of 'com.google.errorprone:error_prone_annotations' that satisfies the version constraints:
Dependency path 'sdfsf:app:unspecified' --> 'com.google.truth:truth:1.0' --> 'com.google.errorprone:error_prone_annotations:2.3.1'
Constraint path 'sdfsf:app:unspecified' --> 'com.google.errorprone:error_prone_annotations:{strictly 2.2.0}' because of the following reason: debugRuntimeClasspath uses version 2.2.0
Dependency path 'sdfsf:app:unspecified' --> 'com.google.guava:guava:27.0.1-android' --> 'com.google.errorprone:error_prone_annotations:2.2.0'
Как я могу исправить эту проблему сборки?