Gradle包括Maven

Was*_*aer 0 android gradle maven

我在Github上找到了一个库,我希望将其包含在我的Android项目中(我使用Android Studio),它使用Maven进行分发.不幸的是,在Github页面上添加了Mavens pom.xml文件时,我无法弄清楚如何在Gradle中包含这个库:

<dependency>
  <groupId>com.github.japgolly.android</groupId>
  <artifactId>svg-android</artifactId>
<version>2.0.6</version>
Run Code Online (Sandbox Code Playgroud)

Github页面是https://github.com/japgolly/svg-android

到目前为止,我的build.gradle文件(无效):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.tg.myapplication"
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven { url 'http://github.com/japgolly/svg-android' }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile 'svg-android:2.0.6'
}
Run Code Online (Sandbox Code Playgroud)

Gaë*_*tan 7

试试这个:

compile 'com.github.japgolly.android:svg-android:2.0.6'