2

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:

Mayur Gajra
  • 6,167
  • 3
  • 18
  • 34
Atif Sheikh
  • 85
  • 2
  • 12
  • below is my repositories tag where I have mentioned maven tag: allprojects { repositories { maven { url "http://jcenter.bintray.com" } } } – Atif Sheikh Feb 17 '19 at 07:06

2 Answers2

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()
      ………..
   }
}
Kourosh
  • 188
  • 2
  • 10
  • 1
    Hi Kourosh, thank you for answering, I have already added jcenter() in my repositories but still getting the same error. After replacing compile tag with implementation tag I am getting this below error: gradle DSL method not found : 'implementation()' – Atif Sheikh Feb 17 '19 at 08:08
  • @AtifSheikh you must update the gradle plugin in your project/build.gradle. check this link : https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio – Kourosh Feb 17 '19 at 08:51
0

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'
        //
    }
}
Gabriele Mariotti
  • 250,295
  • 77
  • 670
  • 690