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さんありがとうございます(*´ェ`*)
@sakura_bird1 Gradleでは1.2.3までしか取得できません。
— みやけん/Miyaken (@cyberspacefarm) 2015, 9月 1
@sakura_bird1 んー単純にあがってないだけかと。ソースをビルドするか、自分のローカルに登録するのがいいと思います。
— みやけん/Miyaken (@cyberspacefarm) 2015, 9月 1
ところで、作者様のChris BanesさんはPhotoViewはdeprecatedと言っています。
pull requestは送れるけど、返事は期待しないで欲しいとあります。
忙しいのが原因のようなのでメンテナンスに興味がある人はコンタクトしてくれと言ってますね。