1

我這裏有一個ListView - :誤差積分PlusOneButton谷歌API密鑰

<android.support.v4.widget.SwipeRefreshLayout 
     android:id="@+id/main_refresh" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     tools:showIn="@layout/activity_main"> 

     <ListView 
      android:id="@+id/list" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:divider="@color/colorGrey" 
      android:dividerHeight="5dp" 
      tools:listitem="@layout/item" /> 

</android.support.v4.widget.SwipeRefreshLayout> 

而且還有一個自定義項目 - :

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:srcCompat="@mipmap/ic_image_black_24dp" 
     android:contentDescription="@string/description" /> 

    <TextView 
     android:id="@+id/textView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/app_name" /> 


    <com.google.android.gms.plus.PlusOneButton xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" 
     android:id="@+id/plus_one_button" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     plus:annotation="inline" 
     plus:size="standard" /> 

</LinearLayout> 

我演繹的建議列表。我希望每個提案都有自己的按鈕,但是當我沒有按鍵的情況下添加按鈕時,我還沒有完成!

dependencies { 
    ... 
    compile 'com.google.android.gms: play-services: 10.0.0' 
    compile 'com.google.android.gms: play-services-auth: 10.0.0' 
    compile 'com.google.android.gms: play-services-plus: 10.0.0' 
} 

預覽給人item.xml本 - :

please see this image

我GOOGLE了這個問題,並發現他在其中寫道,如果juzat庫com.google出現此問題的註釋。 android.gms:play-services 7以上的版本,所以我不認爲谷歌扔在Prodakshen不工作版本,因爲它已經超過10日,我懷疑他們改變了API密鑰或類似的東西,我集成了按鈕在谷歌的這個文檔的幫助下:https://developers.google.com/+/mobile/android/recommend是一箇舊的文檔,並有新的?

回答

0

首先,請確保您已經是enabled the Google+ API

然後,您可能需要在更新項目中聲明的依賴關係時檢查是否已使用最新版本play-services完成Set Up Google Play Services

Add Google Play Services to Your Project提到的,

  • 添加下依賴一個新構建規則的play-services最新版本。
  • 確保每次更新Google Play服務時都更新版本號。

    您可能還想檢查(Google plusone (+1) button in Android application integration guide以瞭解更多信息。

    希望有幫助!

    +0

    謝謝你,我做到了,所有更新甚至緩存完全推翻完全重建項目,除按鈕:( – sommelier