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

(초보) gcm 클라이언트 매니페스트 에러 질문 입니다...

0 추천
매니페스트 코드
 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.gcm_test"
    android:versionCode="1"
    android:versionName="1.0" >
   
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

    <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.gcm_test.permission.C2D_MESSAGE"        android:protectionLevel="signature" />   
    <uses-permission android:name="com.example.gcm_test.permission.C2D_MESSAGE" />
   
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
       
        <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.RECEIV"/>
                <category android:name="com.example.gcm_test"/>
            </intent-filter>
           
        </receiver>
       
        <service android:name=".GcmIntentService"/>
       
    </application>

</manifest>

///////////////////////////////////////

위는 매니페스트 소스입니다.

 

로그캣에 뜨는 에러입니다.
 
manifest에 뜨는거인지는 알고있지만... 어떤게 잘못인지는 잘몰르겠어서
이렇게 질문을 올립니다.
 
gcm 처음 RegID를 받아오기위해 서버는 안만들고 클라이언트만 만들어서 실행을 시켯는데 이러한 에러가 뜨네요...
*google gcm 예제를 보고 따라 했습니다.
 
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gcm_test/com.example.gcm_test.MainActivity}: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
JackR (380 포인트) 님이 2014년 8월 11일 질문

1개의 답변

0 추천
 
채택된 답변

로그캣 설명 그대로 입니다.

application 엘리먼트 안에 

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

를 정의해 주세요.

b22n (22,940 포인트) 님이 2014년 8월 11일 답변
JackR님이 2014년 8월 11일 채택됨
...