Frage

I am trying to get GCM running on my Android-App, I am getting this strange error message a short while after GCMRegistrar.register() was called ( app-name is the name of the app I can't disclose):

 java.lang.ClassNotFoundException: Didn't find class 
 "com.<companyname>.<appname>.GCMIntentService" on path: DexPathList[[zip file 
 "/system/framework/com.google.android.maps.jar", zip file "/data/app/<app-
 name>"],nativeLibraryDirectories=[/data/app-lib/<app.name>, 
 /vendor/lib, /system/lib]]

The (I think) relevant part of AndroidManifest:

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

The class GCMIntentService exists at the specified path, I copied the file from the GCM-Client project provided by Google, so I don't really get what the problem is.

Any ideas?

UPDATE: I moved the class GCMIntentService to the following package:

 com.google.android.gcm.demo.app

No I get a warning:

Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION 
flg=0x10 pkg=com.<company-name>.<app-name> 
cmp=com.xitaso.plugsurfing/.GCMIntentService (has extras) } U=0: not found

What does that mean?

War es hilfreich?

Lösung

I figured out what the problem was: The GCMIntentService had to be in the root of the package name, in my case in com.companyname.appname; I created a separate package where I put the GCMIntentService-class, and it worked fine from then on (at least I think that that was the main problem).

Andere Tipps

If you don't use GCM and this exception comes from other library just do this:

 <service
     android:name="package.GCMIntentService"
     tools:node="remove" />
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top