GcmBroadcastReceiver无法解决问题(Android studio)

时间:2015-03-25 08:19:59

标签: android

我的清单文件中有问题说无法识别android:name=".GcmBroadcastReceiver"<service android:name=".GcmIntentService" />,我绝对无法找到解决方案,我真的需要帮助,我已经安装了所有google play服务,也是我用下一个依赖项更新的gradle:

compile 'com.android.support:appcompat-v7:22.0.0',  
compile 'com.google.android.gms:play-services:7.0.0'
compile "com.google.android.gms:play-services-gcm:7.0.0"

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pedrobal.chatonline" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission  android:name="com.google.android.c2dm.permission.RECEIVE" />

<permission
    android:name="com.example.pedrobal.chatonline.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.appsrox.instachat.permission.C2D_MESSAGE" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <receiver
        android:name=".GcmBroadcastReceiver" 
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="com.example.pedrobal.chatonline" />
        </intent-filter>
    </receiver>
    <service android:name=".GcmIntentService" /> 
</application>
</manifest>

1 个答案:

答案 0 :(得分:0)

您应该在项目中的GcmBroadcastReceiver包下创建com.example.pedrobal.chatonline接收器