{ "id": "63924", "key": "TIMOB-3292", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-06T18:29:11.000+0000", "created": "2011-04-15T03:41:31.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-06T18:29:11.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
Titanium Mobile Version: 1.6.0
\nReproduction steps:
\n* Create module that includes a service that runs when the\napplication has been closed (eg titanium-c2dm) * Add the following\nthe the service module:
\nTiJSIntervalService service = new TiJSIntervalService(\"c2dmHandler.js\");\nIntent serviceIntent = new Intent(Intent.ACTION_SEND, Uri.parse(\"app://c2dmHandler.js\"));\nserviceIntent.putExtra(\"interval\", 2000); // work-around for \nservice.onStart(serviceIntent, 1);
\n
\nThe following stack track is dumped:
\n[TRACE] E/TiUncaughtHandler( 384): (IntentService[C2DMBaseReceiver]) [10,1896] Sending event: exception on thread: IntentService[C2DMBaseReceiver] msg:java.lang.NullPointerException; Titanium 1.6.0,2011/02/23 18:08,882e81\n[TRACE] E/TiUncaughtHandler( 384): java.lang.NullPointerException\n[TRACE] E/TiUncaughtHandler( 384): at org.appcelerator.titanium.TiBaseService.createTiContext(TiBaseService.java:126)\n[TRACE] E/TiUncaughtHandler( 384): at ti.modules.titanium.android.TiJSService.createProxy(TiJSService.java:92)\n[TRACE] E/TiUncaughtHandler( 384): at ti.modules.titanium.android.TiJSService.onStart(TiJSService.java:48)\n[TRACE] E/TiUncaughtHandler( 384): at com.example.mobile.C2DMReceiver.jsHandleMessage(C2DMReceiver.java:92)\n[TRACE] E/TiUncaughtHandler( 384): at com.example.mobile.C2DMReceiver.onMessage(C2DMReceiver.java:67)\n[TRACE] E/TiUncaughtHandler( 384): at com.google.android.c2dm.C2DMBaseReceiver.onHandleIntent(C2DMBaseReceiver.java:101)\n[TRACE] E/TiUncaughtHandler( 384): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)\n[TRACE] E/TiUncaughtHandler( 384): at android.os.Handler.dispatchMessage(Handler.java:99)\n[TRACE] E/TiUncaughtHandler( 384): at android.os.Looper.loop(Looper.java:123)\n[TRACE] E/TiUncaughtHandler( 384): at android.os.HandlerThread.run(HandlerThread.java:60)\n[TRACE] E/AndroidRuntime( 384): FATAL EXCEPTION: IntentService[C2DMBaseReceiver]\n[TRACE] E/AndroidRuntime( 384): java.lang.NullPointerException\n[TRACE] E/AndroidRuntime( 384): at org.appcelerator.titanium.TiBaseService.createTiContext(TiBaseService.java:126)\n[TRACE] E/AndroidRuntime( 384): at ti.modules.titanium.android.TiJSService.createProxy(TiJSService.java:92)\n[TRACE] E/AndroidRuntime( 384): at ti.modules.titanium.android.TiJSService.onStart(TiJSService.java:48)\n[TRACE] E/AndroidRuntime( 384): at com.example.mobile.C2DMReceiver.jsHandleMessage(C2DMReceiver.java:92)\n[TRACE] E/AndroidRuntime( 384): at com.example.mobile.C2DMReceiver.onMessage(C2DMReceiver.java:67)\n[TRACE] E/AndroidRuntime( 384): at com.google.android.c2dm.C2DMBaseReceiver.onHandleIntent(C2DMBaseReceiver.java:101)\n[TRACE] E/AndroidRuntime( 384): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)\n[TRACE] E/AndroidRuntime( 384): at android.os.Handler.dispatchMessage(Handler.java:99)\n[TRACE] E/AndroidRuntime( 384): at android.os.Looper.loop(Looper.java:123)\n[TRACE] E/AndroidRuntime( 384): at android.os.HandlerThread.run(HandlerThread.java:60)
\n
Workaround: fire the intent directly instead of creating a\nTiService
\n\nString serviceClass = \"com.hyro.mobile.C2dmBackgroundService\";\nIntent serviceIntent = new Intent(Intent.ACTION_SEND, Uri.parse(\"app://c2dmBackground.js\"));\nserviceIntent.putExtra(\"interval\", 2000); // .currentService undefined for non-interval services\nserviceIntent.setClassName(context, serviceClass);\ncontext.startService(serviceIntent);
\n
Assigning to hopefully the correct person.
Daniel it would be helpful if you could attach a complete\nexample to speed up the reproduction and possible fix.
Full source for reproduction against 1.6.1 attached.
\nReproduction steps:
\nStart \"Ticket3292\" app
\nStart \"Ticket3292 invoker\" app
\nSelect the \"Notification to native service invoking js\"\nnotification