如何在Android Studio中使用Maven

5

我想在我的项目中使用bottomBar库。当我在build.gradle文件中添加正确的gradle命令并进行sync时,出现以下错误:

Failed to resolve: com.roughike:bottom-bar:2.0

我已经为此问题做了很多搜索。一个解决方案是使用jcenter(),但是在我的国家无法访问,并且同步需要长达1个小时或在某些情况下需要两个小时。因此,我改用maven。 在这种情况下,我该如何使用库主页推荐的maven命令? 我应该把以下代码放在哪里?
<dependency>
  <groupId>com.roughike</groupId>
  <artifactId>bottom-bar</artifactId>
  <version>2.+</version>
  <type>pom</type>
</dependency>

这可能会有帮助 - https://dev59.com/hGQn5IYBdhLWcg3wpYj0#16675271 - CodeWalker
1个回答

1
Gradle
dependencies {
        compile 'com.roughike:bottom-bar:2.+'
}

如果同步gradle时出现错误,请运行代理(Host=127.0.0.1,proxyPort=8580)并在命令提示符中输入此命令。

gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580

enter image description here


我应该把Maven放在我的项目哪里?这是一个文件吗? - Shima Erfan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接