Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1201] Unable to start receiver com.appcelerator.cloudpush.PushBroadcastReceiver

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2014-08-25T23:42:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules
LabelsTCSupportTriage, android, defect
ReporterAndrey Tkachenko
AssigneeMauro Parra-Miranda
Created2014-07-22T16:59:19.000+0000
Updated2016-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

FileDateSize
log.txt2014-07-22T16:59:19.000+000037938

Comments

  1. Shuo Liang 2014-08-01

    Hi, Would you please provide us the test case for your problem. That will be really helpful. Regards, Shuo
  2. Andrey Tkachenko 2014-08-06

    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);
           });
       
       }
       
  3. Andrey Tkachenko 2014-08-09

    May be no difference between 4.4.2 and 4.2.2. On second emulator app may already get message.
  4. Mauro Parra-Miranda 2014-08-25

    Closed by customer's last comment.

JSON Source