每当我从我的python服务器向我的客户端发送GCM消息时,我都会收到以下错误:
logcat-android studio: 致命异议:主要 过程:com.example.ozblumenfeld.myapplication2,PID:22895 java.lang.RuntimeException:无法实例化服务com.example.MyGcmListenerService:java.lang.ClassNotFoundException:未找到类" com.example.MyGcmListenerService"在路径上:DexPathList [[zip文件
我添加到清单文件:
<service
android:name="com.example.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
和许可:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
和类MyGcmListenerService:
import com.google.android.gms.gcm.GcmListenerService;
public class MyGcmListenerService extends GcmListenerService {