Androidはワンツーパンチ 三歩進んで二歩下がる

プログラミングやどうでもいい話

PhotoViewライブラリを使おうとしたらCould not find com.github.chrisbanes.photoview:library:1.2.4.とgradleに怒られた

偉大なるPhotoViewを我がプロジェクトに取り込むにあたり、エラーに遭遇しました。
その時のメモです。github.com

githubの説明のとおりにbuild.gradleに記述しました。

repositories {
  mavenCentral()
}

dependencies {
  compile 'com.github.chrisbanes.photoview:library:1.2.4'
}

syncすると次のようにエラーになってしまいました。

Error:A problem occurred configuring project ':XXXXX'.
> Could not resolve all dependencies for configuration ':XXXXX:_debugCompile'.
   > Could not find com.github.chrisbanes.photoview:library:1.2.4.
     Searched in the following locations:
         https://jcenter.bintray.com/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.pom
         https://jcenter.bintray.com/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.jar
         https://repo1.maven.org/maven2/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.pom
         https://repo1.maven.org/maven2/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.jar
         file:/Users/sakura/Library/Android/sdk/extras/android/m2repository/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.pom
         file:/Users/sakura/Library/Android/sdk/extras/android/m2repository/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.jar
         file:/Users/sakura/Library/Android/sdk/extras/google/m2repository/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.pom
         file:/Users/sakura/Library/Android/sdk/extras/google/m2repository/com/github/chrisbanes/photoview/library/1.2.4/library-1.2.4.jar
     Required by:
         XXXXX:XXXXX:unspecified

なんだかんだで検索してdependenciesのバージョン部分を+に変えることで使えるようになりました。

dependencies {
  compile 'com.github.chrisbanes.photoview:library:+'
}

追記
@cyberspacefarmさまにご指摘をいただきましたので追記いたします。@cyberspacefarmさんありがとうございます(*´ェ`*)



ところで、作者様のChris BanesさんはPhotoViewはdeprecatedと言っています。
pull requestは送れるけど、返事は期待しないで欲しいとあります。
忙しいのが原因のようなのでメンテナンスに興味がある人はコンタクトしてくれと言ってますね。

https://plus.google.com/app/basic/stream/z13yuharpqelwjhi104ccvnr4laohrh44jo?cbp=1jxcjaqven8ic&sview=27&cid=5&soc-app=115&soc-platform=1&spath=/app/basic/%2BChrisBanes/posts&sparm=cbp%3Dwbxl0oejft6h%26sview%3D27%26cid%3D5%26soc-app%3D115%26soc-platform%3D1%26stct%3DChYQ44bfiYrWxwIY2K7dx-HVxwIgACgCEhQIABDYrt3H4dXHAhjIm7XKuObFAhgCIBgol6CC5oiPuf-KAQ%26spath%3D/app/basic/s%26sparm%3Dsc%253Dpo%2526sq%253Dchrisbanes%252Bphotoview