Android 错误集成PlusOneButton google api密钥

Android 错误集成PlusOneButton google api密钥,android,android-studio,google-api,google-play-services,google-plus,Android,Android Studio,Google Api,Google Play Services,Google Plus,我这里有一个列表视图-: <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_b

我这里有一个列表视图-:

<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>
预览为item.xml提供了以下内容-:

<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>


我在谷歌上搜索了这个问题,发现了一条评论,他在评论中写道,如果juzat library com.google.android.gms:播放7版以上的服务,就会出现这个问题,所以我不认为谷歌加入了Prodakshen不工作的版本,因为它已经过了10号,我怀疑他们更改了api密钥或类似的东西,我在谷歌的文档帮助下集成了这个按钮:是一个旧文档,有新文档吗?

首先,请确保您已经有了

然后,在更新项目中声明的依赖项时,您可能需要检查是否已经使用了最新版本的
play services

如中所述

  • 在最新版本的
    播放服务的依赖项下添加新的生成规则
  • 确保每次Google Play服务更新时都会更新版本号

    您可能还需要检查此项以了解更多信息


    希望有帮助

    首先,请确保您已经

    然后,在更新项目中声明的依赖项时,您可能需要检查是否已经使用了最新版本的
    play services

    如中所述

  • 在最新版本的
    播放服务的依赖项下添加新的生成规则
  • 确保每次Google Play服务更新时都会更新版本号

    您可能还需要检查此项以了解更多信息


    希望有帮助

    谢谢,我做了所有的,所有的更新,甚至缓存完全推翻完全重建项目,除按钮外一切正常:(谢谢,我做了所有的,所有的更新,甚至缓存完全推翻完全重建项目,除按钮外一切正常:(