'Dependency Failed to resolve: com.github.barteksc:android-pdf-viewer:2.8.1

I know that this has been asked before, but despite adding maven in repositories cant resolve this error. please help.

Following is my module level gradle file:

Following is my top level gradle file:



Solution 1:[1]

Try this:

implementation 'com.github.barteksc:android-pdf-viewer:3.1.0-beta.1'

or if you want a more stable version:

implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'

and add jCenter in your repositories:

allprojects {
   repositories {
       jcenter()
      ………..
   }
}

Solution 2:[2]

Change your module/build.gradle script.

repositories {
    google()
    jcenter()
}

dependencies {
   //....
   implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
}

To use the implementation DSL you have to update the gradle plugin for android in the top level file:

buildscript {
    repositories {
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        //
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kourosh
Solution 2 Gabriele Mariotti