Unknown errors and warnings while implementing GCM client side

耗尽温柔 提交于 2019-12-07 19:34:45

问题


I'm trying to implement GCM client example found at Github but am not able to recelve notifications in my MyGcmListenerService.java

when i go through logs generated at my android studio logcat, i find this warnings and error messages

Warnings

10-07 15:22:47.160  29844-29844/com.me.myapp W/asset﹕ AssetManager-->
addDefaultAssets CIP path not exsit!
10-07 15:22:47.352  29844-29844/com.me.myapp W/dalvikvm﹕ VFY: unable to resolve
virtual method 247: Landroid/app/Notification$Builder;.setLocalOnly (Z)
Landroid/app/Notification$Builder;

10-07 15:22:47.352  29844-29844/com.me.myapp W/dalvikvm﹕ VFY: unable to resolve
 instance field 18

10-07 15:22:47.359  29844-29844/com.me.myapp W/dalvikvm﹕ VFY: unable to resolve 
virtual method 1507: Landroid/os/UserManager;.getApplicationRestrictions
 (Ljava/lang/String;)Landroid/os/Bundle;

Errors

10-07 15:03:37.070  10177-10177/com.me.myapp E/dalvikvm﹕ Could not find class 
'android.os.UserManager', referenced from method com.google.android.gms.common
.GooglePlayServicesUtil.zzah

10-07 15:03:37.156  10177-10177/com.me.myapp E/dalvikvm﹕ Could not find class 
'android.app.AppOpsManager', referenced from method com.google.android.gms.common.
GooglePlayServicesUtil.zzb

10-07 15:03:38.117  10177-10197/com.me.myapp E/GMPM﹕ getGoogleAppId failed with
 status: 10

10-07 15:03:38.132  10177-10197/com.me.myapp E/GMPM﹕ Uploading is not possible.
 App measurement disabled

10-07 15:07:11.320  10306-10306/com.me.myapp E/SensorManager﹕ thread start

10-07 15:07:17.164  10306-10703/com.me.myapp E/API_TASK﹕ Read timed out

Question

  • how can i solve some or all or of this errors and warnings?
  • Do they have to do with my failure to receive notifications from GCM server ?

回答1:


The stated errors and problems have nothing to do with receiving gcm notifications. for my case. gcmid received from gcm connection server wasn't being saved at datastore. the entity responsible for saving it was badly implemented thus i coundn't receive messages or notifications from GCM Connection servers.

  • Make sure gcmId received from connection servers is well saved in your app server.(i use objectify to achieve this)

  • Also make use of Logger class at your backend module in order to track your implementation by printing out logs(messages) at important stages. e.g when you receive gcmid (you can implement this at the frontend thus use Log.d() method), if gcmid have been saved to your app server( here you use entities to do that and its here where you use Logger class because this takes place at backend module).

Still stucked? comment below to ask for help



来源:https://stackoverflow.com/questions/32992387/unknown-errors-and-warnings-while-implementing-gcm-client-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!