I can't import PhotoView.What should I do?

1.3k Views Asked by At

I do not understand what to do with this plugin, I have been suffering for an hour .. My version is android studio 7.0.2 here is the code

 photoViewVersion = "2.3.0"
}
dependencies {
implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}``` 
2

There are 2 best solutions below

0
Kilian On BEST ANSWER

Try adding maven { url "https://jitpack.io" } to your top level gradle build file.

See: https://github.com/Lichenwei-Dev/ImagePicker/issues/1

0
Karunesh Palekar On

Make sure you have the following in the build.gradle(Project level)

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

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

Also try putting the dependency in the following manner in your gradle file (App level)

dependencies {
 def photoViewVersion = "2.3.0"
 implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}