2012-10-10 2 views
1

그래서 기본적으로이 자습서를 단계별로 수행했습니다. http://developer.android.com/guide/google/gcm/demo.html 서버를 만들어서 "No devices registered!" 내가해야 할 일은 앱을 시작하는 것입니다. 즉, 내 문제가 시작됩니다. 로그 고양이는 등록 :GCM 앱이 실행/디버그시 에뮬레이터에 설치되지 않음

"Trace - error opening trace file: no such file or directory (2) 
AndroidRunTime - Shutting Down VM 
dalvikvm - threadid=1: thread exiting with uncaught exception (group=0x40a13300) 
AndroidRunTime - FATAL EXCEPTION: main" 

MANIFEST : 그런데

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.google.android.gcm.demo.app" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/> 
    <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.google.android.gcm.demo.app.permission.C2D_MESSAGE" 
     android:protectionLevel="signature" /> 
    <uses-permission 
     android:name="com.google.android.gcm.demo.app.permission.C2D_MESSAGE" /> 
    <uses-permission 
     android:name="com.google.android.c2dm.permission.RECEIVE" /> 

    <!-- Main activity. --> 
    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" > 
     <activity 
      android:name=".DemoActivity" 
      android:label="@string/app_name" 
      android:screenOrientation="portrait" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

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

     <receiver 
      android:name="com.google.android.gcm.GCMBroadcastReceiver" 
      android:permission="com.google.android.c2dm.permission.SEND" > 
      <intent-filter> 
       <!-- Receives the actual messages. --> 
       <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 
       <!-- Receives the registration id. --> 
       <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> 
       <category android:name="com.google.android.gcm.demo.app" /> 
      </intent-filter> 
     </receiver> 

     <service android:name=".GCMIntentService" /> 
    </application> 

</manifest> 

, 나는 문제가 내 형편 프로그램에서하지 있는지 확인하기 위해 프로젝트를 수입했다.

답변

0

Google API 에뮬레이터인지 확인하십시오. 또한 에뮬레이터에 Gmail 계정으로 로그인하십시오. 당신이 GCM 데모 응용 프로그램의 모든 가이드를 따라 한 경우

0

에뮬레이터에서 GCM을 실행하려면 에뮬레이터에서 Google 계정을 만들어야합니다. 너는 그것을 만들었 니? 에뮬레이터가 성공적으로 실행되면 Logcat의 메시지 만 표시합니다.

-1

, 당신이 당신의 캐치되지 않는 예외를 캡처 할 수 있습니다 :

import android.content.Context; 
import android.os.Process; 

public class ExceptionHandler implements UncaughtExceptionHandler{ 

    public ExceptionHandler() { 
    } 

    @Override 
    public void uncaughtException(Thread thread, Throwable ex) { 

      // capture the exception information 

     Process.killProcess(Process.myPid()); 
     System.exit(0); 
    } 

    } 

그리고 주요 활동 :

@Override 
public void onCreate(Bundle bundle) { 

    Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler()); 
} 
관련 문제