0

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"
}``` 
  • 1
    What is the issue exactly ? Does the gradle sync fails ? If it does what does it say ? Is there a red line or something ? Elaborate more on the error . – Karunesh Palekar Sep 11 '21 at 15:21
  • Failed to resolve: com.github.chrisbanes:PhotoView:2.3.0 Show in Project Structure dialog Affected Modules: app.Other versions are also not displayed it also writes: error: package com.github.chrisbanes.photoview does not exist import com.github.chrisbanes.photoview.PhotoView; – user16801724 Sep 11 '21 at 16:38

2 Answers2

1

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"
}
Karunesh Palekar
  • 2,190
  • 1
  • 9
  • 18
0

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

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

Kilian
  • 275
  • 2
  • 8