当前位置: 动力学知识库 > 问答 > 编程问答 >

google play services - Android: Can't able to import GoogleApiClient in Eclipse

问题描述:

I have imported BaseGameUtil library.

But I can't able to import com.google.android.gms.common.api.GoogleApiClient

Even I have added google-play-services-lib in this library.

I had set Google APis 4.1.2 as a project target.

网友答案:

You dont need to import this. Just Import

import com.google.example.games.basegameutils.GameHelper;

then create

GameHelper gameHelper;

setup it like this

if (gameHelper == null) {
    gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
    gameHelper.enableDebugLog(true);
}

gameHelper.setup(this);

and get GoogleApiClient this way

gameHelper.getApiClient()
分享给朋友:
您可能感兴趣的文章:
随机阅读: