현재 gcm을 이용하여 어플 개발중인데 GCMRegistrar.register여기서 자꾸 에러가 걸립니다.


어플을 다운로드 후 처음 실행시 regId값을 받지 못하고 종료 후 다시 실행해보면 regID값을 받아 옵니다. 


도대체 뭐가 문제인지 정말 모르겠네요.... 좀 알려주세요...ㅠㅠ


정말 이거 때문에 미치겠네요.... 벌써 이것때문에 몇시간째 헤매고 있는 건지..ㅠㅠ 고수님들 해결법 좀 알려주세요...ㅠㅠ



============== 소스 부분 ==================


private void registGCM() {

GCMRegistrar.checkDevice(this);

//Checks if the device has the proper dependencies installed.

//단말이 GCM을 지원하는지 검사

GCMRegistrar.checkManifest(this);

//Checks that the application manifest is properly configured.

//응용프로그램의 매니페스트가 제대로 구성되어 있는 지 확인

final String regId = GCMRegistrar.getRegistrationId(this);

//Gets the current registration id for application on GCM service.

//GCM서비스의 응용프로그램에 대한 현재 등록 ID를 가져옴.

if("".equals(regId))   //구글 가이드에는 regId.equals("")로 되어 있는데 Exception을 피하기 위해 수정

GCMRegistrar.register(this, GCMIntentService.SEND_ID); <--- 여기서 에러가 걸립니다.

//Initiate messaging registration for the current application.

//현재 응용 프로그램에 메시징 등록을 시작

else

tv.setText(regId);

Log.d("==============", regId);

    }


====================================================


=================== 에러 메세지 ======================

08-24 21:50:03.400: E/ActivityThread(5331): Activity pe.sbk.gcmsample.GCMSampleActivity has leaked IntentReceiver com.google.android.gcm.GCMBroadcastReceiver@414ea898 that was originally registered here. Are you missing a call to unregisterReceiver()?

08-24 21:50:03.400: E/ActivityThread(5331): android.app.IntentReceiverLeaked: Activity pe.sbk.gcmsample.GCMSampleActivity has leaked IntentReceiver com.google.android.gcm.GCMBroadcastReceiver@414ea898 that was originally registered here. Are you missing a call to unregisterReceiver()?

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:763)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:567)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1112)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1099)

08-24 21:50:03.400: E/ActivityThread(5331): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:355)

08-24 21:50:03.400: E/ActivityThread(5331): at com.google.android.gcm.GCMRegistrar.setRetryBroadcastReceiver(GCMRegistrar.java:293)

08-24 21:50:03.400: E/ActivityThread(5331): at com.google.android.gcm.GCMRegistrar.register(GCMRegistrar.java:215)

08-24 21:50:03.400: E/ActivityThread(5331): at pe.sbk.gcmsample.GCMSampleActivity.registGCM(GCMSampleActivity.java:53)

08-24 21:50:03.400: E/ActivityThread(5331): at pe.sbk.gcmsample.GCMSampleActivity.onCreate(GCMSampleActivity.java:22)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.Activity.performCreate(Activity.java:4465)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ActivityThread.access$600(ActivityThread.java:127)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)

08-24 21:50:03.400: E/ActivityThread(5331): at android.os.Handler.dispatchMessage(Handler.java:99)

08-24 21:50:03.400: E/ActivityThread(5331): at android.os.Looper.loop(Looper.java:137)

08-24 21:50:03.400: E/ActivityThread(5331): at android.app.ActivityThread.main(ActivityThread.java:4507)

08-24 21:50:03.400: E/ActivityThread(5331): at java.lang.reflect.Method.invokeNative(Native Method)

08-24 21:50:03.400: E/ActivityThread(5331): at java.lang.reflect.Method.invoke(Method.java:511)

08-24 21:50:03.400: E/ActivityThread(5331): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)

08-24 21:50:03.400: E/ActivityThread(5331): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)

08-24 21:50:03.400: E/ActivityThread(5331): at dalvik.system.NativeStart.main(Native Method)


====================================================================================================