drive.changes().watch returns GoogleJsonResponseException: 401 Unauthorized without any message
I'm trying to watch for changes in Google Drive, and getting 401 Exception. Searching here, i found that people have detailed messages, why they are not unauthorized though i have nothing. Here the code i use: public static void main(String[] args) { try { httpTransport = GoogleNetHttpTransport.newTrustedTransport(); dataStoreFactory = new FileDataStoreFactory(DATA_STORE_DIR); // authorization GoogleCredential credential = GoogleCredential.getApplicationDefault() .createScoped(DriveScopes.all()); boolean refreshed = credential.refreshToken(); // set up the global Drive instance drive = new