Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2008] Failed to register for GCM push notification

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionFixed
Resolution Date2014-01-07T19:29:28.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterKrish
AssigneeJon Alter
Created2014-01-07T15:20:56.000+0000
Updated2016-03-08T07:40:57.000+0000

Description

*My code:*\\
var CloudPush = require('ti.cloudpush');
var Cloud = require('ti.cloud');
var deviceToken = '0';

CloudPush.debug = true;
CloudPush.enabled = true;
CloudPush.showTrayNotificationsWhenFocused = true;
CloudPush.focusAppOnPush = false;
        
CloudPush.retrieveDeviceToken({
    success : function deviceTokenSuccess(e) {
		deviceToken = e.deviceToken;
		alert('Device Token: ' + deviceToken);
    },
    error : function deviceTokenError(e) {
		alert('Failed to register for push! ' + e.error);
    }
});
*Error Message:*\\ SERVICE_MISSING *Error Log:*\\ {noformat} [INFO] : dalvikvm: Could not find method android.app.Application.onTrimMemory, referenced from method org.appcelerator.titanium.TiApplication.onTrimMemory [WARN] : dalvikvm: VFY: unable to resolve virtual method 132: Landroid/app/Application;.onTrimMemory (I)V [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [891,891] Titanium 3.2.0 (2013/12/10 19:16 1de32ee) [INFO] : TiApplication: (main) [368,1259] Titanium Javascript runtime: v8 [WARN] : dalvikvm: VFY: unable to resolve new-instance 34 (Landroid/app/Notification$Builder;) in Lcom/appcelerator/cloud/push/PushBroadcastReceiver; [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [INFO] : dalvikvm: Could not find method android.app.Activity.invalidateOptionsMenu, referenced from method org.appcelerator.titanium.proxy.ActivityProxy.handleInvalidateOptionsMenu [WARN] : dalvikvm: VFY: unable to resolve virtual method 56: Landroid/app/Activity;.invalidateOptionsMenu ()V [ERROR] : dalvikvm: Could not find class 'android.app.Notification$Builder', referenced from method com.appcelerator.cloud.push.PushBroadcastReceiver.showNotification [WARN] : V8Object: Runtime disposed, cannot set property 'userAgent' [INFO] : dalvikvm: Failed resolving Lti/modules/titanium/ui/widget/searchview/TiUISearchView; interface 669 'Landroid/widget/SearchView$OnQueryTextListener;' [WARN] : dalvikvm: Link of class 'Lti/modules/titanium/ui/widget/searchview/TiUISearchView;' failed [ERROR] : dalvikvm: Could not find class 'ti.modules.titanium.ui.widget.searchview.TiUISearchView', referenced from method ti.modules.titanium.ui.widget.TiUITableView.processProperties [WARN] : dalvikvm: VFY: unable to resolve check-cast 3032 (Lti/modules/titanium/ui/widget/searchview/TiUISearchView;) in Lti/modules/titanium/ui/widget/TiUITableView; [INFO] : dalvikvm: Could not find method android.view.View.setTranslationX, referenced from method org.appcelerator.titanium.view.TiUIView.resetTranslationX [WARN] : dalvikvm: VFY: unable to resolve virtual method 3726: Landroid/view/View;.setTranslationX (F)V [INFO] : dalvikvm: Could not find method android.view.View.setTranslationY, referenced from method org.appcelerator.titanium.view.TiUIView.resetTranslationY [WARN] : dalvikvm: VFY: unable to resolve virtual method 3727: Landroid/view/View;.setTranslationY (F)V [INFO] : dalvikvm: Could not find method android.view.View.setAlpha, referenced from method org.appcelerator.titanium.view.TiUIView.setAlpha [WARN] : dalvikvm: VFY: unable to resolve virtual method 3694: Landroid/view/View;.setAlpha (F)V [ERROR] : dalvikvm: Could not find class 'android.app.Notification$Builder', referenced from method ti.cloudpush.CloudpushModuleGeneric.showTrayNotification [WARN] : dalvikvm: VFY: unable to resolve new-instance 34 (Landroid/app/Notification$Builder;) in Lti/cloudpush/CloudpushModuleGeneric; [WARN] : CloudpushModule: (KrollRuntimeThread) [3320,3320] Setting 'enabled' is not required for GCM; it is sufficient to only 'retrieveDeviceToken'. [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.ontreat.it.gs3music.ThreegSoundActivity@40593c98 [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 975 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 971 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 985 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 982 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 979 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 977 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 972 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 969 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 983 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 974 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 973 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 970 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 984 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 981 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 978 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve static field 976 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string; [WARN] : dalvikvm: VFY: unable to resolve instance field 35 [WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; [ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. [WARN] : GooglePlayServicesUtil: Google Play services is missing. [INFO] : ALERT: (KrollRuntimeThread) [1887,1887] Failed to register for push! Google Play Services is not ready. Error:SERVICE_MISSING [INFO] : dalvikvm: Could not find method android.graphics.Bitmap.getByteCount, referenced from method org.appcelerator.titanium.util.TiImageLruCache.sizeOf {noformat}

Comments

  1. Jon Alter 2014-01-07

    When you are using GCM push, you are using the Google Play services SDK. "To test your app when using the Google Play services SDK, you must use Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher." http://developer.android.com/google/play-services/setup.html I recommend running with the latest API Level (19 at the time of writing). You may get an error saying that Google Play services needs to be updated if you run with an older api level on the emulator. *Note:* When testing on device you need a "compatible Android device that runs Android 2.3 or higher and includes Google Play Store".
  2. Jon Alter 2014-01-07

    Feel free to comment or reopen if the issue is not resolved.

JSON Source