google / java-photoslibrary

Java client library for the Google Photos Library API
http://developers.google.com/photos
Apache License 2.0
107 stars 64 forks source link

Error when trying to list albums #10

Closed panovvitalik closed 5 years ago

panovvitalik commented 5 years ago

Code: OAuth2Credentials credentials = OAuth2Credentials.create(new AccessToken(getAccessToken(), null)); PhotosLibrarySettings settings = PhotosLibrarySettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(credentials)) .build(); PhotosLibraryClient photosLibraryClient = PhotosLibraryClient.initialize(settings); InternalPhotosLibraryClient.ListAlbumsPagedResponse response = photosLibraryClient.listAlbums()

Getting error: Caused by: java.lang.NoSuchMethodError: No static method transform(Lcom/google/common/util/concurrent/ListenableFuture;Lcom/google/common/base/Function;)Lcom/google/common/util/concurrent/ListenableFuture; in class Lcom/google/common/util/concurrent/Futures; or its super classes (declaration of 'com.google.common.util.concurrent.Futures' appears in /data/app/vitalypanov.phototracker.pro-a1gsQRkAKNKD4SrP8tSkbw==/split_lib_dependencies_apk.apk!classes2.dex) at com.google.api.core.ApiFutures.transform(ApiFutures.java:99) at com.google.api.gax.paging.AbstractPage.createPageAsync(AbstractPage.java:66) at com.google.photos.library.v1.internal.InternalPhotosLibraryClient$ListAlbumsPage.createPageAsync(InternalPhotosLibraryClient.java:1713) at com.google.photos.library.v1.internal.InternalPhotosLibraryClient$ListAlbumsPagedResponse.createAsync(InternalPhotosLibraryClient.java:1673) at com.google.photos.library.v1.internal.stub.PhotosLibraryStubSettings$7.getFuturePagedResponse(PhotosLibraryStubSettings.java:512) at com.google.photos.library.v1.internal.stub.PhotosLibraryStubSettings$7.getFuturePagedResponse(PhotosLibraryStubSettings.java:503) at com.google.api.gax.rpc.PagedCallable.futureCall(PagedCallable.java:63) at com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126) at com.google.api.gax.rpc.UnaryCallable.futureCall(UnaryCallable.java:87) at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112) at com.google.photos.library.v1.internal.InternalPhotosLibraryClient.listAlbums(InternalPhotosLibraryClient.java:793) at com.google.photos.library.v1.internal.InternalPhotosLibraryClient.listAlbums(InternalPhotosLibraryClient.java:771) at com.google.photos.library.v1.PhotosLibraryClient.listAlbums(PhotosLibraryClient.java:201)

My build.gradle has those strings: implementation 'io.grpc:grpc-protobuf:1.10.1' implementation 'io.grpc:grpc-stub:1.10.1' implementation 'io.grpc:grpc-okhttp:1.10.1' implementation 'com.google.photos.library:google-photos-library-client:1.1.0'

What's wrong? How can I resolve this ussue?

panovvitalik commented 5 years ago

I was cut off using of this "shi..." library from my project. And reimplemented all work with direct REST calls. "Thank you"

So question is not actual.