【问题标题】:GoogleApiClient.ConnectionCallbacks error compile timeGoogleApiClient.ConnectionCallbacks 错误编译时间
【发布时间】:2014-03-24 22:49:17
【问题描述】:

我应该使用 google drive bat 我无法编译此活动

package com.google.android.gms.drive.sample.demo;

import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

/**
 * An abstract activity that handles authorization and connection to the Drive
 * services.
 */
public abstract class BaseDemoActivity extends Activity implements
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener {
...

我使用 Google Plugin for Eclipse 来安装库和 Google API 但是由于编译错误

GoogleApiClient cannot be resolved to a type

【问题讨论】:

  • 您是如何包含 GoogleApiClient 库的?它是您添加到项目中的 jar 吗?你的导入正确吗?你错过了import com.google.android.gms.common.api.GoogleApiClient;吗?
  • 嗯不是,如何在我的项目中导入。它会自动执行插件吗?
  • 是但不能编译,请看截图

标签: android google-drive-api google-api-client


【解决方案1】:

按照Google+ Platform Quickstart for Android 将Google Play 服务安装为库项目

具体参见第 5 步:

5. Import the Google Play Services library project.

    Select File > Import > Android > Existing Android Code Into Workspace and click Next.
    Select Browse.... Enter <android-sdk-folder>/extras/google/google_play_services/.
    Select google-play-services_lib. Click Finish to import.

【讨论】:

    猜你喜欢
    • 2015-05-20
    • 2012-10-04
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 2020-04-17
    • 1970-01-01
    • 2013-05-18
    • 1970-01-01
    相关资源
    最近更新 更多