마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

gcm을 사용하려고 하는데요!

0 추천

안녕하세요 안드로이드를 독학한지 3주 정도 된 초보입니다.

단순히 예제만보고 gcm을 써볼려고 하는데요 

메니페스트작성중에

Cannot resolve symbol 'GcmBroadcastReceiver'

Cannot resolve symbol 'GcmIntentService'

라고 나오는데 뭐가 문제인지 모르겠어요 ㅠ

안드로이드 스튜디오를 사용중이구요 

sdk로 Google Play Service 설치도 됬는데 왜 이러는 건지 모르겠네요

 
* build.gradle 에 추가한 내용입니당
 
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
 
    compile 'com.google.android.gms:play-services:6.5.87' //이것만 추가했어요
 
}
 
 
*manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ch.mygcm" >

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <permission android:name="com.example.ch.mygcm.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.example.ch.mygcm.permission.C2D_MESSAGE" />

    <uses-permission
        android:name="com.google.android.c2dm.permission.RECEIVE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/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.ch.mygcm" />
            </intent-filter>
        </receiver>
        <service android:name=".GcmIntentService" />

    </application>

</manifest>

 

해결방법을 제시해주시면 감사하겠습니다!

 

라이온푸 (190 포인트) 님이 2015년 1월 20일 질문

1개의 답변

0 추천
 
채택된 답변
해당 클래스를 찾을 수 없다는 에러입니다.

GCM을 구현하시려면

푸님의 프로젝트 패키지 내에 GcmIntentService와 GcmBroadcastReceiver를 구현해 주셔야 합니다~^^
안드로이드로우 (15,740 포인트) 님이 2015년 1월 20일 답변
라이온푸님이 2015년 1월 20일 채택됨
...