javiersantos/AppUpdater

build.gradle dependency error

ciammarica opened this issue · 3 comments

  • I have verified there are no duplicate active or recent bugs, questions, or requests.
  • I have verified that I am using the latest version of AppUpdater.
  • I have given my issue a non-generic title.
  • I have read over the README and WIKI (before asking questions on how to do something).
Details
  • AppUpdater version: 2.6.1
  • Android Studio version: 2.3.2
  • Gradle version: 3.3
  • Android plugin version: 2.3.2
Reproduction Steps
  1. Add the repository to your project build.gradle:
repositories {
    maven {
        url "https://jitpack.io"
    }
}
  1. Add the library to your module build.gradle:
dependencies {
    compile 'com.github.javiersantos:AppUpdater:2.6.1'
}
  1. Sync project
Expected Result

Project build with no errors.

Actual Result

Error message: "Failed to resolve: com.github.javiersantos:AppUpdater:2.6.1"

hpng6 commented

same problem to me also.

Hello,
I guess you did put repository definition inside buildscript in your build.gradle.
Check that you have your jitpack repository definition outside of buildscript.
It´s working for me.

wrong:

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }
 }

ok:

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

As @IAmEska says, the Jitpack repository should be placed outside of buildscript. Please follow this example.

apply plugin: 'com.android.application'

android {
    ....
}

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    ...
    compile 'com.github.javiersantos:AppUpdater:[LATEST_VERSION]'
}