Shima Erfan
Shima Erfan

Reputation: 457

How to use maven in android studio

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>

Upvotes: 5

Views: 2406

Answers (1)

Ahmad Aghazadeh
Ahmad Aghazadeh

Reputation: 17131

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

Upvotes: 1

Related Questions