2015-04-20 136 views
2

我嘗試將我的android應用程序集成到g +。我嘗試添加PlusClient來初始化它。但AndroidStudio說:Cannot resolve PlusClient。 我添加了這些進口頭:無法解析PlusClient

import com.google.android.gms.plus.Plus; 

而且,我tryed添加這些進口頭:

import com.google.android.gms.plus.PlusClient; 

但我使用22 API PlusClient.plus. AndroidStudio找不到。 如何解決它? Api仍然支持PlusClient? Plus和PlusClient有什麼不同?

回答

1

PlusClient不是Android的文檔中,所以它可能不存在。使用GoogleApiClient

GoogleApiClient client = new GoogleApiClient.Builder(this) 
    .addApi(Plus.API) 
    .addScope(Plus.SCOPE_PLUS_LOGIN) 
    .setAccountName("[email protected]") 
    .build(); 
client.connect(); 
+0

我無法解決加...我在我的gradle中使用compile'c​​om.google.android.gms:play-services-auth:8.4.0' –

1

我想你應該更新你的谷歌Play服務版本23.You應該加入谷歌Play服務,因爲庫項目,你的項目

+0

我已經做了這件事,但沒有任何改變 – pragmus

0

的PlusClient無法找到更新打造專業化工具23.0.2之後,因此,使用GoogleApiClient代替。

+0

can被評論!!! – theLazyFinder