How to use maven in android studio

2019-04-30 02:48发布

I want to use bottomBar library in my project. When I add the proper gradle command in the build.gradle file and sync, I get this error:

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

I have searched a lot for the reason. A solution is to use jcenter(), but this is not accessible in my country and syncing lasts up to 1 or in some cases two hours. So I use maven instead. In this case how can I use the maven commands recommended on the library home page? Where should I put the following code?

<dependency>
  <groupId>com.roughike</groupId>
  <artifactId>bottom-bar</artifactId>
  <version>2.+</version>
  <type>pom</type>
</dependency>

1条回答
对你真心纯属浪费
2楼-- · 2019-04-30 03:24

Gradle

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

If error sync gradle run a proxy(Host=127.0.0.1 , proxyPort=8580) and type this command in cmd

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

enter image description here

查看更多
登录 后发表回答