I am trying to see if it is possible to use the old version of GCM, pre-2012, that does not use google play services. The devices I am working on are not allowed to install google play services, but we want to use the deprecated GCM using gcm.jar. When I run the app on the device, I get this error:
07-28 16:02:36.216 20714-20714/com.jcp.pushnotifications E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.jcp.pushnotifications, PID: 20714
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jcp.pushnotifications/com.jcp.pushnotifications.MainActivity}: java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2248)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5050)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:780)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:596)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf
at com.google.android.gcm.GCMRegistrar.checkDevice(GCMRegistrar.java:98)
at com.jcp.pushnotifications.MainActivity.onCreate(MainActivity.java:61)
at android.app.Activity.performCreate(Activity.java:5256)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2248)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5050)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:780)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:596)
at dalvik.system.NativeStart.main(Native Method)
My question is, is it possible to load the com.google.android.gsf package onto the device? I have tried adding a google-common.jar file that contains this package, but after adding that lib to project, it still gets the package not loaded on device error above.