0
votes

I am trying to include the HoloColorPicker library (or for that matter any other library in my project), however, I cannot seem to get it to download.

The dependency section in my build.gradle file looks like:

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.1.+'
compile 'com.google.android.gms:play-services-wearable:6.5.+'
compile 'com.android.support:support-v13:21.0.+'
compile 'com.larswerkman:HoloColorPicker:1.5+'
wearApp project(':Wearable') 

The error message I get is as follows:

What went wrong: A problem occurred configuring project ':Application'. Could not resolve all dependencies for configuration ':Application:_debugCompile'.

Could not find any version that matches com.larswerkman:HoloColorPicker:1.5+. Searched in the following locations: file:/Users/Tom/Library/Android/sdk/extras/android/m2repository/com/larswerkman/HoloColorPicker/maven-metadata.xml file:/Users/Tom/Library/Android/sdk/extras/android/m2repository/com/larswerkman/HoloColorPicker/ file:/Users/Tom/Library/Android/sdk/extras/google/m2repository/com/larswerkman/HoloColorPicker/maven-metadata.xml file:/Users/Tom/Library/Android/sdk/extras/google/m2repository/com/larswerkman/HoloColorPicker/ Required by: watchfaces2.0:Application:unspecified

I cannot seem to figure out why Android Studio is looking for the library under my local path as opposed to pulling the library down from the internet. How can I get past this issue?

2
Did you add the library to your project at all? to write the line in dependencies will help just if the gradle system could find matched files in your project or in repositories. The library you trying to use is not in Maven so you need to add it to your preject. - yshahak
Which library should I be adding @yshahak - rmoh21

2 Answers

3
votes

Have you included Maven in your gradle file?

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.support:wearable:1.1.+'
    compile 'com.google.android.gms:play-services-wearable:6.5.+'
    compile 'com.android.support:support-v13:21.0.+'
    compile 'com.larswerkman:HoloColorPicker:1.5+'
    wearApp project(':Wearable')
}
2
votes

Just for complete the picture:

dependencies {
    repositories {
         mavenCentral()
    }
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.support:wearable:1.1.+'
    compile 'com.google.android.gms:play-services-wearable:6.5.+'
    compile 'com.android.support:support-v13:21.0.+'
    compile 'com.larswerkman:HoloColorPicker:1.5+'
    wearApp project(':Wearable')
}