1

Загружаю такую зависимость

     <dependency>
        <groupId>androidx.navigation</groupId>
        <artifactId>navigation-ui</artifactId>
        <version>2.1.0</version>
        <type>aar</type>
    </dependency>

У нее в зависимостях matrerial 1.0.0 Добавляю в зависимости

    <dependency>
        <groupId>com.google.android.material</groupId>
        <artifactId>material</artifactId>
        <version>1.0.0</version>
        <type>aar</type>
    </dependency>

Пишет ошибку:

Could not resolve dependencies for project org.hello:gs-maven-android:apk:0.1.0: Failure to find com.google.android.material:material:jar:1.0.0 in https://maven.google.com/ was cached in the local repository, resolution will not be reattempted until the update interval of mvnrepository has elapsed or updates are forced

То есть оно пытается найти jar, хотя jar нет на репозитории, только aar. Как это исправить?

1 ответ 1

1

На сайте зависимости androidx.navigation указано что используется Google репозиторий:

Note: this artifact it located at Google repository (https://maven.google.com/)

Вам нужно добавить в Ваш pom.xml запись об этом репозитории:

  <repositories>
    <repository>
      <id>google</id>
      <url>https://maven.google.com</url>
    </repository>
  </repositories>

К слову. Зависимость com.google.android.material загрузится автоматически при подключении androidx.navigation зависимости. Отдельно её прописывать в pom.xml не надо.

Introduction to Repositories

3
  • Репозиторий прописан. При этом найти все равно не может. Вот скрин ошибки i.imgur.com/D8q161M.png Тут material не прописан и maven сам лезет искать его, но не находит. По ошибке вижу, что он ищет jar, а не aar. Когда прописываю зависимости aar вручную добавляю <type>aar</type>, а тут так понимаю надо сделать чтобы оно само искало aar. Может это где-то прописать нужно? 22 дек 2019 в 23:56
  • Скрин pom.xml Вашего с репозиторием.
    – Tsyklop
    23 дек 2019 в 10:44
  • Вот минимальный pom.xml, при котором возникает ошибка i.imgur.com/5GGrYrl.png 23 дек 2019 в 11:29

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.