Could not resolve library in android studio

I am trying to add a third-party library to gradle. It shows the following error:

enter image description here

Here is my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    compileOptions.encoding = 'ISO-8859-1'
    defaultConfig {
        applicationId "com.attendme.io"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.4" //1.4.1
        //multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile files('libs/kandy-1.6.160.jar')
    compile files('libs/gcm.jar')
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    //compile 'com.google.android.gms:play-services-gcm:8.4.0'
    //compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'com.squareup.okhttp3:okhttp:3.2.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.github.ParkSangGwon:TedPicker:v1.0.10'


}

When I looked for this problem, I found some solutions, but they did not work for me. How can I fix this problem?

+4
source share
3 answers

You need to add 2 maven repositories.

So make sure your build.gradle (Project) includes this

allprojects {
    repositories {
        jcenter()
        maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
        maven { url "https://jitpack.io" }
    }
}

and this happens in your build.gradle (app) file

compile 'com.github.ParkSangGwon:TedPicker:v1.0.10'
+8
source

You should also add repositories to your build.gradle. Put these repositories in the tag repositories. Put those above the tag android.

repositories {
    maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
    maven { url "https://jitpack.io" }

}
+1

cwac- . jitpack.io

repositories {
    jcenter()
    maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
    maven { url "https://jitpack.io" }

}

dependencies {
      compile 'com.github.ParkSangGwon:TedPicker:v1.0.10'
}

Add permission for camera, external storage, as well as runtime for android6. Read the official documentation for more information.

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+1
source

All Articles