liccowee/Google-Cloud-Messaging--Titanium-

Unable to start service Intent...GCMIntentService not found

Closed this issue · 13 comments

Hi,

I'm very confused so I have no clue about where exactly is the problem located at.

I copied these lines to my tiapp.xml (from example/tiapp.xml), deleted the icon line, and changed the sender_id:

      <modules>
            <module platform="android" version="0.3">com.activate.gcm</module>
        </modules>
    </android>
    <property name="com.activate.gcm.sender_id" type="string">00000000</property> <!-- put your sender_id here -->
    <property name="com.activate.gcm.icon" type="int">2130837504</property> <!-- get this from R.java, but converted to decimal, 0x7f020000 give you 2130837504 (type "0x7f020000 to decimal" in google) -->
    <property name="com.activate.gcm.component" type="string">gcm.gcm/gcm.gcm.GcmActivity</property> <!-- [package name]/[package name].[activity name] -->

When I run the application I get this error, I guess it has something to do with the GCMIntentService but I don't know where the problem is:

09-26 22:05:38.333: V/GCMBroadcastReceiver(13553): onReceive: com.google.android.c2dm.intent.REGISTRATION
09-26 22:05:38.333: V/GCMBroadcastReceiver(13553): GCM IntentService class: com.myapp.myapp.GCMIntentService
09-26 22:05:38.333: V/GCMBaseIntentService(13553): Acquiring wakelock
09-26 22:05:38.343: W/ActivityManager(163): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION cat=[com.myapp.myapp] cmp=com.myapp.myapp/.GCMIntentService (has extras) }: not found

I also tried to execute gcm.registerC2dm like the JS example, but I'm getting no success (no success, error or callback functions are executed).

Searching in Google only makes it worst. People writes more lines in the tiapp.xml than the example in gtihub.

I can't understand also the point 6 in the "Readme.nd":

6.Now what you want to do is create the interface class between Java native code with titanium javascript using the Kroll Method. 

What am I missing? Thank you!

Thanks for this module, I hope I can make it work so I can enjoy it :)

Ok, I just used the zip on the "dist" folder, instead of compiling it by myself. Seems its working fine so far. Maan... so many hours lost compiling and recompiling, trying to create the module when it was already compiled in the dist folder here, in the github project.

Thanks anyway!

I used the existing zip, but got the same error, so in case someone else running into this:
Make sure you are using Google API on your emulator.

i used the exisiting zip and i have the same error ?? if i delete this line

< property name="com.activate.gcm.component" type="string">gcm.gcm/gcm.gcm.GcmActivity <!-- [package name]/[package name].[activity name] -- >

from tiap.xml and i click into the notification the android system gives me a list to choice with what app i will execute it !! so the probleme is there ?? not ?

@Ezzi : look at this comment made by @miklos-martin in another thread #9 (comment)

Don't delete this line, change the gcm.gcm/gcm.gcm.GcmActivity line to something like this: com.domain.appname/com.domain.appname.appnameActivity, if you wanna be sure that what you're writing here is correct you just have to check the generated AndroidManifest.xml in the build/android directory, as @miklos-martin said in his commentary. 👍

@miklos-martin thanks man
notes : the appname should be with capital first letter :) AppnameActivity ;)

You're welcome :)

use this inside your GCMIntentService:
public GCMIntentService() {
super(GlobalConstants.SENDER_ID);
}

hi, I used module com.activate.gcm-android-0.4.. i have placed module on .titanium/modules/android..
and i have copied too on the root of project..
here my tiapp.xml :


"

        8
        
            com.activate.gcm
        
    
    
        com.activate.gcm
    
    00000000
    2130837504
    gcm.gcm/gcm.gcm.GcmActivity
"

and i get an error :

[ERROR]TiJSError( 2158) [302,3276] ----- Titanium Javascript Runtime Error -----
[ERROR]TiJSError( 2158) [4,3280] - In ti:/module.js:372,8
[ERROR]TiJSError( 2158) [2,3282] - Message: Uncaught Error: Requested module not found: com.activate.gcm
[ERROR]TiJSError( 2158) [2,3284] - Source: throw new Error("Requested module not found: " + request);
[ERROR][V8Exception( 2158)] Exception occurred at ti:/module.js:372: Uncaught Error: Requested module not found: com.activate.gcm

Any help is appreciated.

Try to copy it in ROOT_OF_PROJECT/modules/android/com.activate.gcm

@miklos-martin
yes i have copied it to ROOT_OF_PROJECT/modules/android/com.activate.gcm..

but it's still an error module not found..
do you have tutorial or an example using gcm on titanium?

thank u very much..

No, unfortunately I have no complete tutorial on using this.
Could you please post your tiapp.xml again? It's a bit broken.
And by the way, it should show up in the tiapp editor's modules section in Titanium Studio.

the modules show up in the tiapp editor's, but app can find it..
here is my tiapp.xml..

<modules>
    <module platform="android" version="0.4">com.activate.gcm</module>
</modules>
<property name="com.activate.gcm.sender_id" type="string">00000000</property>
<property name="com.activate.gcm.icon" type="int">2130837504</property>
<property name="com.activate.gcm.component" type="string">gcm.gcm/gcm.gcm.GcmActivity</property>

I am facing same problem above,
I am using com.activate.gcm 0.6 module also all properties is set in tiapp.xml.
also i am using same code from example folder, but when i am running my app then "gcm.registerc2dm" is not responding any success,callback,error. I am stuck here and lost lots of hours to solve this but not able to figure out what is the problem.

I read that c2dm service is stopped from July 30,2015. Is it the reason why gcm.registerc2dm is not responding.

Also i read from https://developers.google.com/cloud-messaging/android/client,
but not sure how to use this with appcelerator android.

Thanks for any help