How To Add Maven Dependency (Android Studio)

Char picture Char · Jan 6, 2017 · Viewed 12.5k times · Source

I have this code below..

<dependency>
    <groupId>me.gujun.android.taggroup</groupId>
    <artifactId>library</artifactId>
    <version>1.4</version>
    <type>apklib</type>
</dependency>

But where do you put this in Android Studio? I've already placed a dependency in build.gradle which is compile 'me.gujun.android.taggroup:library:1.4@aar'

Answer

ymerdrengene picture ymerdrengene · Apr 29, 2018

In Android Studio 3.0 and above, you can just copy

<dependency>
    <groupId>me.gujun.android.taggroup</groupId>
    <artifactId>library</artifactId>
    <version>1.4</version>
    <type>apklib</type>
</dependency>

into build.gradle, and it automatic converts it to:

implementation 'me.gujun.android.taggroup:library:1.4'