Google应用引擎移动应用获取错误

时间:2014-09-22 19:03:39

标签: android google-app-engine

我正在使用谷歌应用引擎端点在Android中创建移动应用程序。我创建了端点,并通过创建简洁的端点库在我的移动应用程序中添加所有jar和包。

这是我创建构建器和调用API的代码

Employeeendpoint.Builder builder = new Builder(
            AndroidHttp.newCompatibleTransport(), new JacksonFactory(),
            null);
    builder = CloudEndpointUtils.updateBuilder(builder);
    Employeeendpoint endpoint = builder.build();
    try {

        Employee s = endpoint.getEmployee("2").execute();

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

但这会让我失误,

Could not find class 'com.appspot.fuogydemo.employeeendpoint.Employeeendpoint$Builder', referenced from method com.example.sample.MainActivity.onCreate

我的应用程序中存在此类的位置

public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
    com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
  super(
      transport,
      jsonFactory,
      DEFAULT_ROOT_URL,
      DEFAULT_SERVICE_PATH,
      httpRequestInitializer,
      false);
}

/** Builds a new instance of {@link Employeeendpoint}. */
@Override
public Employeeendpoint build() {
  return new Employeeendpoint(this);
}

@Override
public Builder setRootUrl(String rootUrl) {
  return (Builder) super.setRootUrl(rootUrl);
}

@Override
public Builder setServicePath(String servicePath) {
  return (Builder) super.setServicePath(servicePath);
}

@Override
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
  return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}

@Override
public Builder setApplicationName(String applicationName) {
  return (Builder) super.setApplicationName(applicationName);
}

@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
  return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}

@Override
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
  return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
}

@Override
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
  return (Builder) super.setSuppressAllChecks(suppressAllChecks);
}

/**
 * Set the {@link EmployeeendpointRequestInitializer}.
 *
 * @since 1.12
 */
public Builder setEmployeeendpointRequestInitializer(
    EmployeeendpointRequestInitializer employeeendpointRequestInitializer) {
  return (Builder) super.setGoogleClientRequestInitializer(employeeendpointRequestInitializer);
}

@Override
public Builder setGoogleClientRequestInitializer(
    com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
  return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}

}

所以请任何人帮我解决问题所在。 提前谢谢。

0 个答案:

没有答案