i have checked most of the available material on GcmIntentServices but couldn't figure out the problem i am facing..
The Push notification code is provided on the login page and the next page is homeScreen, but the intent occurs without fail.. yet after some time on the home page.. the app crashes..
my log cat provides the following error..
E/AndroidRuntime(1449): FATAL EXCEPTION: main
E/AndroidRuntime(1449): Process: com.example.smss, PID: 1449
E/AndroidRuntime(1449): java.lang.RuntimeException: Unable to instantiate service
com.example.smss.GCMIntentService: java.lang.ClassNotFoundException:
Didn't find class "com.example.smss.GCMIntentService" on path:
DexPathList[[zip file "/data/app/com.example.smss-1.apk"],
nativeLibraryDirectories=[/data/app-lib/com.example.smss-2, /vendor/lib, /system/lib]]
E/AndroidRuntime(1449): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2556)
E/AndroidRuntime(1449): at android.app.ActivityThread.access$1800(ActivityThread.java:135)
E/AndroidRuntime(1449): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime(1449): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(1449): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(1449): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(1449): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(1449): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(1449): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(1449): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(1449): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(1449): Caused by: java.lang.ClassNotFoundException:
Didn't find class "com.example.smss.GCMIntentService" on path:
DexPathList[[zip file "/data/app/com.example.smss-1.apk"],
nativeLibraryDirectories=[/data/app-lib/com.example.smss-2, /vendor/lib, /system/lib]]
E/AndroidRuntime(1449): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime(1449): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/AndroidRuntime(1449): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/AndroidRuntime(1449): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2553)
E/AndroidRuntime(1449): ... 10 more
why is this occuring??
this is my manifest..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.smss"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<!-- GCM connects to Internet Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<permission
android:name="com.example.smss.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.smss.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Network State Permissions to detect Internet status -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Permission to vibrate -->
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.smss.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>
<!-- Register Activity -->
<activity
android:name="com.quinoid.sms.pushnotifications.RegisterActivity"
android:label="@string/app_name" >
</activity>
<!-- Main Activity -->
<activity
android:name="com.quinoid.sms.pushnotifications.InitialActivity"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name" >
</activity>
<activity android:name="com.example.smss.homepage"></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.androidhive.pushnotifications" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>