[AC-1201] Unable to start receiver com.appcelerator.cloudpush.PushBroadcastReceiver
| GitHub Issue | n/a |
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2014-08-25T23:42:42.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Appcelerator Modules |
| Labels | TCSupportTriage, android, defect |
| Reporter | Andrey Tkachenko |
| Assignee | Mauro Parra-Miranda |
| Created | 2014-07-22T16:59:19.000+0000 |
| Updated | 2016-03-08T07:37:34.000+0000 |
Description
Unable to start app in Android 4.4.2 emulator but 4.2.2 work without exception. Gapps installed on both avd.
{noformat}
FATAL EXCEPTION: main
Process: com.myapp, PID: 2336
java.lang.RuntimeException: Unable to start receiver com.appcelerator.cloudpush.PushBroadcastReceiver: java.lang.NullPointerException: PushType is NONE!
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2426)
at android.app.ActivityThread.access$1700(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException: PushType is NONE!
at com.appcelerator.cloudpush.CCPushService.ifEnabled(CCPushService.java:240)
at com.appcelerator.cloudpush.PushBroadcastReceiver.onReceive(PushBroadcastReceiver.java:59)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2419)
... 10 more
{noformat}
Attachments
| File | Date | Size |
| log.txt | 2014-07-22T16:59:19.000+0000 | 37938 |
Hi, Would you please provide us the test case for your problem. That will be really helpful. Regards, Shuo
I forgot include my commonjs module that contains subscription code. Without subscription code will exception thrown. Subscription code :
if (Ti.Platform.osname == 'android') { var CloudPush = require('ti.cloudpush'); var Cloud = require('ti.cloud'); Cloud.debug = true; CloudPush.debug = true; CloudPush.focusAppOnPush = false; CloudPush.showTrayNotification = true; CloudPush.showTrayNotificationsWhenFocused = true; CloudPush.showAppOnTrayClick = true; CloudPush.retrieveDeviceToken({ success : function(e) { CloudPush.enabled = true; Ti.API.info('retrieved device token: ' + e.deviceToken); Ti.App.Properties.setString('pushNotification.deviceToken', e.deviceToken); }, error : function(e) { Ti.API.error(e.error); } }); CloudPush.addEventListener('callback', function(evt) { Ti.API.info('New push message: ' + JSON.stringify(evt)); Ti.App.fireEvent('app:CloudPush.callback', evt); }); CloudPush.addEventListener('trayClickLaunchedApp', function(evt) { Ti.App.fireEvent('app:CloudPush.trayClickLaunchedApp', evt); }); CloudPush.addEventListener('trayClickFocusedApp', function(evt) { Ti.App.fireEvent('app:CloudPush.trayClickFocusedApp', evt); }); }May be no difference between 4.4.2 and 4.2.2. On second emulator app may already get message.
Closed by customer's last comment.