1

I want add this dependencies compile 'com.github.ar-android:DrawRouteMaps:1.0.0' into my Android studio Project.
When add this into dependencies and click on Sync show me this error :

Error:(39, 13) Failed to resolve: com.github.ar-android:DrawRouteMaps:1.0.0
<a href="openFile:G:/Android/Projects/1-MapTutorial/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

build.gradle codes:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'

    defaultConfig {
        applicationId "com.example.mohammadn.a1_maptutorial"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

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

    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.google.android.gms:play-services:9.2.1'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.google.android.gms:play-services-maps:9.2.1'
    testCompile 'junit:junit:4.12'

    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.google.code.gson:gson:2.6.1'

    compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
}

How can I fix it and add this library into my dependencies?

5 Answers5

2

Add support jitpact repository in root build.gradle at the end of repositories:

    allprojects {
   repositories {
    maven { url "https://jitpack.io" }
   }
}

Read official guideline about DrawRouteMaps .

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
  • When add this line and sync show me this error, please see this email : https://s13.postimg.org/6fmeq9k7b/image.png –  Apr 17 '17 at 12:48
1

Try adding following lines to project/build.gradle (not app/build.gradle)

allprojects {
   repositories {
    maven { url "https://jitpack.io" }
  }
}

app/build.gradle

compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
PEHLAJ
  • 9,980
  • 9
  • 41
  • 53
  • When add this line and sync show me this error, please see this email : https://s13.postimg.org/6fmeq9k7b/image.png –  Apr 17 '17 at 12:47
  • Try clean & build – PEHLAJ Apr 17 '17 at 12:48
  • http://stackoverflow.com/questions/35842955/manifest-merger-failed-with-multiple-errors-in-android-studio. – PEHLAJ Apr 17 '17 at 12:49
  • What is your minSdkVersion? You need to change it to 16 as mentioned in http://stackoverflow.com/questions/35842955/manifest-merger-failed-with-multiple-errors-in-android-studio – PEHLAJ Apr 17 '17 at 12:50
  • See minSdkVersion here on https://github.com/ar-android/DrawRouteMaps/blob/master/app/build.gradle – PEHLAJ Apr 17 '17 at 12:53
1

First, you have to add the Maven Repository in your project:

allprojects {
   repositories {
    maven { url "https://jitpack.io" }
   }
}

And then, add dependencies in build.gradle module app :

dependencies {
    compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
}
Luiz Fernando Salvaterra
  • 4,192
  • 2
  • 24
  • 42
1

Add this to your project: build.gradle file to this

allprojects {
   repositories {
    maven { url "https://jitpack.io" }
   }
}
Junaid Hafeez
  • 1,618
  • 1
  • 16
  • 25
  • When add this line and sync show me this error, please see this email : https://s13.postimg.org/6fmeq9k7b/image.png –  Apr 17 '17 at 12:47
  • @AngelF you need to change your `minSdkVersion 14` to `minSdkVersion 16`. Let me know if problem still persists. – Junaid Hafeez Apr 17 '17 at 12:50
1

In addition to above comments you can add dependencies in file->project structure-> add->+(plus sign)->add library