【问题标题】:Gmail API get messages 'cannot resolve method execute()'Gmail API 获取消息“无法解析方法执行()”
【发布时间】:2016-05-31 16:05:13
【问题描述】:

我正在尝试运行 Users.messages:list(如下)的示例 java 代码。但是,我的 IDE (IntelliJ) 在 'execute()' 方法上出错:

'无法解析方法execute()'

我有必要的依赖,google-api-services-gmail-v1-rev43-1.2.2.0.jar。我还缺少另一个依赖项吗?

 /**
   * List all Messages of the user's mailbox matching the query.
   *
   * @param service Authorized Gmail API instance.
   * @param userId User's email address. The special value "me"
   * can be used to indicate the authenticated user.
   * @param query String used to filter the Messages listed.
   * @throws IOException
   */
  public static List<Message> listMessagesMatchingQuery(Gmail service, String userId,String query) throws IOException {
    ListMessagesResponse response = service.users().messages().list(userId).setQ(query).execute();

错误:无法解析方法执行()编译

【问题讨论】:

    标签: java api intellij-idea gmail


    【解决方案1】:

    我有同样的问题。 尝试在 gradle 文件中添加此依赖项,它解决了我的问题。

    编译 'com.google.apis:google-api-services-gmail:v1-rev48-1.22.0'

    【讨论】:

      猜你喜欢
      • 2021-03-25
      • 2018-09-29
      • 2020-12-31
      • 2017-07-28
      • 2015-11-07
      • 2016-03-18
      • 2015-03-13
      • 2019-10-13
      • 2016-12-23
      相关资源
      最近更新 更多