People API return new AuthorizationCodeInstalledApp(flow, new LocalServerReceive failed?

356 views
Skip to first unread message

Guy Dviri

unread,
Sep 7, 2018, 12:21:19 PM9/7/18
to Google APIs Explorer Users Forum
return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");

that error :

Failed resolution of: Ljava/awt/Desktop; Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.Desktop" on path: DexPathList[[zip file "/data/app  why?
Message has been deleted

Guy Dviri

unread,
Sep 9, 2018, 5:52:35 AM9/9/18
to Google APIs Explorer Users Forum
if someone ever looking for the solution for this issue so here it is:

Collection<String> scopes = new ArrayList<>();

scopes.add(Scopes.PROFILE);
credential = GoogleAccountCredential.usingOAuth2( this, scopes);

credential.setSelectedAccountName(mFirebaseAuth.getCurrentUser().
getEmail());

userProfile = null;

PeopleService service = new PeopleService.Builder(http_transport, JSON_FACTORY, credential)
.setApplicationName(mainActivity.getResources().getString(R.string.app_name)).build();
Person userProfile = service.people().get("people/100889827937171513174").setRequestMaskIncludeField("person.biographies,person.birthdays,person.genders,person.phone_numbers").execute();
Reply all
Reply to author
Forward
0 new messages