1

I'm working on an Android App which is using Google's GCM. It's also working pretty well, apart from the fact that it sometimes takes a huge amount of time to initialize the GCM receiver side (tested on a Galaxy S3 and OnePlus One).

I now reviewed the debugger on the S3 and noticed the output below right before GCM finally initializes its receiver (The GCM Token loads instantly perfect after the start).

I already spent hours googling it and I know that it has something to do with the different API levels, but shouldn't be GCM something pretty basic? Because I also couldn't figure out how to solve this directly via code, it just seems to get fixed by Android itself but with the mentioned time delay of over 30 seconds, so it's pretty annoying and should obviously have a better solution.

// Edit: sorry forgot to mention what I'm using. The GCM implementation is pretty much the quickstart-sample from here Dependencies are

compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-location:8.3.0'
compile 'com.android.support:appcompat-v7:23.0.1'

and

    minSdkVersion 15
    targetSdkVersion 23

The S3 has API Level version 18.

The Output:

I/dalvikvm: Could not find method android.content.Context.getSystemService, referenced from method ----.GCMPushReceiverService.access$super

W/dalvikvm: VFY: unable to resolve virtual method 707: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object;

D/dalvikvm: VFY: replacing opcode 0x6f at 0x0035

I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method ----.GCMPushReceiverService.access$super

W/dalvikvm: VFY: unable to resolve virtual method 687: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;

D/dalvikvm: VFY: replacing opcode 0x6f at 0x004f

I/dalvikvm: Could not find method android.content.ContextWrapper.getCodeCacheDir, referenced from method ----.GCMPushReceiverService.access$super

[ ... ]

D/dalvikvm: VFY: replacing opcode 0x6f at 0x0335

I/dalvikvm: DexOpt: illegal method access (call Lcom/google/android/gms/gcm/GcmListenerService;.zzgU (I)Z from Lcom/----/GCMPushReceiverService;)

I/dalvikvm: Could not find method com.google.android.gms.gcm.GcmListenerService.zzgU, referenced from method ----.GCMPushReceiverService.access$super

W/dalvikvm: VFY: unable to resolve virtual method 35966: Lcom/google/android/gms/gcm/GcmListenerService;.zzgU (I)Z

D/dalvikvm: VFY: replacing opcode 0x6f at 0x03a5

I/dalvikvm: Could not find method android.content.ContextWrapper.getSystemServiceName, referenced from method ----.GCMPushReceiverService.access$super

W/dalvikvm: VFY: unable to resolve virtual method 787: Landroid/content/ContextWrapper;.getSystemServiceName (Ljava/lang/Class;)Ljava/lang/String;

[...]

D/dalvikvm: GC_FOR_ALLOC freed 678K, 37% free 14563K/22812K, paused 28ms, total 28ms

I/dalvikvm-heap: Grow heap (frag case) to 18.212MB for 2995216-byte allocation

D/dalvikvm: GC_FOR_ALLOC freed 3K, 33% free 17484K/25740K, paused 26ms, total 26ms

Tjong
  • 11
  • 3
  • This doesn't show anything abnormal. Some methods do not exist on old API levels, this basically tells you when such method is referenced but the library is written in a way that handles it gracefully. I can't see an issue from this. – Eugen Pechanec Aug 18 '16 at 12:55
  • The GCM code I used was basically the quickstartsample (which I now linked above). I'm curious that these methods are not supported on API Level 18 (or even higher regarding my OPO). – Tjong Aug 18 '16 at 13:01

0 Answers0