1

This is my first time to make remote repository. But I am facing some problem in accessing it. Following are my gradle files:

root gradle file

 // Top-level build file where you can add configuration options 
 common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

gradle file

 apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.imagelettericon"
    minSdkVersion 11
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.github.akashandroid90:imageletter:1.0'
}

and each time when I sync the code I am getting same error

Failed to resolve: com.github.akashandroid90:imageletter:1.0

I have follow this and this link to make my repo. But now I am not able to access it in gradle file.

Pang
  • 9,564
  • 146
  • 81
  • 122
Akash Jain
  • 437
  • 2
  • 13

1 Answers1

1

Yo have to change your dependency.
compile 'com.github.akashandroid90:imageletter:1.0' is wrong.

Reading the doc in the github repo you should use.

dependencies {
    compile 'com.imageletter:ImageLetterIcon:1.0'
}

However you can check the dependency in the jcenter repo.
Reading the pom file in the repo, I have some doubs about the name.
It should be:

compile 'com.github.akashandroid90:image-letter-icon:1.0'

You can use another way to add a dependency with a github project,using the github repo and the jitpack plugin
In this case you have to add this repo tp your build.gradle

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

and the dependency:

dependencies {
        compile 'com.github.User:Repo:Tag'
    }

In your case it is

compile 'com.github.akashandroid90:ImageLetterIcon:1.0'

More info here.

Community
  • 1
  • 1
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841