Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with push messages (service hanging until reboot / messages not processed) #31

Closed
RalfJung opened this issue Aug 18, 2015 · 37 comments

Comments

@RalfJung
Copy link

I have the following behavior with TextSecure, using the push messaging implementation from this project: TextSecure only seems to "notice" new messages when it is in foreground, on the screen.

For example, I had my phone in stand-by for a while, and I now know that I did receive some messages during that time. I then turned on the screen and unlocked the phone. I waited for ~10-20sec, nothing happened. I started TextSecure, and now I got all the notifications about the messages that I received.

@RalfJung
Copy link
Author

@mar-v-in Here you go, the bug report I promised ;-)

@bonanza123
Copy link

I assume a log is needed here.
Btw., see the last comments/reports in signalapp/Signal-Android#970

@RalfJung
Copy link
Author

I just received some messages while the phone was in standby, so this is not entirely reproducible either. The bug above happened while being on a highway, so maybe it is related to unreliable data connection. Still, once the device re-gains connectivity, it should get the messages and notify me.

Now, with other TextSecure messages having the same problem, maybe TextSecure is doing something suboptimal (I have no idea what they could do wrong), or maybe the Google implementation has its troubles as well.

@dajoe
Copy link

dajoe commented Aug 20, 2015

Textsecure uses the push message for a wakeup event and notification. Getting the message only when textsecure is in foreground could mean that microg has disconnected from the gms server, I experience the same issue.

You should check your logcat if the heartbeat still occurs:

08-20 23:08:17.641 D/GmsGcmMcsSvc(5851): Incoming message: HeartbeatAck{last_stream_id_received=7}

You can also check push functionality with a small app from play store called push notification tester

@RalfJung
Copy link
Author

You should check your logcat if the heartbeat still occurs:

08-20 23:08:17.641 D/GmsGcmMcsSvc(5851): Incoming message: HeartbeatAck{last_stream_id_received=7}

I can try that; is there a way to get the logs from the time when adb is
not connected? This often happens while I'm traveling, so I don't have
the phone attached to a laptop.

You can also check push functionality with a small app from play store called push notification tester

I don't have play store. (Otherwise, why would I even be interested in
this project ;-) ). Is there a similar app in F-Droid? I couldn't find any.

@bonanza123
Copy link

@RalfJung
Copy link
Author

Great, that seems to work. Next time I get delayed TextSecure messages, I'll check the logs. After some more days of experience I have to say though that often, messages do arrive on time, so I'm no longer sure this issue is actually in GMS rather than in TextSecure.

EDIT: On the other hand, I haven't been in the same situation again that I was in when I experienced the bug: Driving over the highway at high speed, probably losing the connection to the mobile network every now and then.

@jensMF
Copy link

jensMF commented Aug 26, 2015

I have the same problem with the newest TextSecure version released. I tried to build the newest version of android_packages_apps_GmsCore because I have hoped to fix this, but now I'm reading this issue and am not sure...
My girlfriend has the same setting, and the same error on a different device while my friends with official google-services don't have these issue in TextSecure... And Redphone doesn't show me to other Redphone-Users although I should have push-massages know...
I will check the logcat an report back...

@jensMF
Copy link

jensMF commented Aug 26, 2015

Ok, I used the Xposed-Module "FakeGapps" but I realized that I don't need it, because I have OmniRom installed. So I uninstalled FakeGapps and restarted, know everything works fine...
Except an error in the logcat:

W/GCMRegistrarHelper(6156): GCM Not supported: java.lang.UnsupportedOperationExeption: Device does not have package com.google.android.gsf

And I could not test Redphone jet.

@mar-v-in
Copy link
Member

@jensMF
Copy link

jensMF commented Aug 26, 2015

Ok, now I get no error or warning at all. Thank you!

@jensMF
Copy link

jensMF commented Sep 8, 2015

After a few days (1.5 - 2) I have this problem again. The gcm haertbeat masseges in the logcat are not present then, too. After I restart the phone, everything gets back to normal.

@bonanza123
Copy link

Can you provide a full log (maybe including the period where it was still working until it failed)?

@jensMF
Copy link

jensMF commented Sep 22, 2015

It was gone, but now it came back:

09-22 09:30:00.625 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:30:00.625 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=225}
09-22 09:30:01.170 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=225}
09-22 09:31:01.960 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:31:01.960 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=226}
09-22 09:31:02.130 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=226}
09-22 09:32:01.940 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:32:01.945 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=227}
09-22 09:32:02.090 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=227}
09-22 09:33:02.000 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:33:02.005 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=228}
09-22 09:33:02.460 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=228}
09-22 09:34:01.950 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:34:01.950 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=229}
09-22 09:34:02.390 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=229}
09-22 09:35:02.065 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:35:02.065 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=230}
09-22 09:35:02.320 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=230}
09-22 09:36:02.035 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:36:02.035 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=231}
09-22 09:36:02.260 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=231}
09-22 09:37:01.965 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:37:01.970 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=232}
09-22 09:37:02.125 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=232}
09-22 09:38:02.030 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:38:02.055 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=233}
09-22 09:38:02.600 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=233}
09-22 09:39:01.955 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:39:01.955 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=234}
09-22 09:39:02.250 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=234}
09-22 09:40:01.970 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:40:01.970 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=235}
09-22 09:40:02.160 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=235}
09-22 09:41:01.960 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:41:01.960 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=236}
09-22 09:41:02.345 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=236}
09-22 09:42:01.950 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:42:01.950 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=237}
09-22 09:42:02.330 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=237}
09-22 09:43:01.950 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:43:01.950 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=238}
09-22 09:43:02.100 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=238}
09-22 09:44:02.040 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:44:02.065 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=239}
09-22 09:44:02.220 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=239}
09-22 09:45:01.105 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:45:01.105 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=240}
09-22 09:45:01.260 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=240}
09-22 09:46:01.895 D/GmsGcmMcsSvc(2471): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:46:01.895 D/GmsGcmMcsSvc(2471): Outgoing message: HeartbeatPing{last_stream_id_received=241}
09-22 09:46:05.655 D/GmsGcmMcsSvc(2471): Incoming message: HeartbeatAck{last_stream_id_received=241}
09-22 09:46:10.645 D/GmsGcmMcsSvc(2471): I/O error: javax.net.ssl.SSLException: Read error: ssl=0x52d597c0: I/O error during system call, Connection timed out
09-22 09:46:10.645 D/GmsGcmMcsSvc(2471): Teardown initiated, reason: javax.net.ssl.SSLException: Read error: ssl=0x52d597c0: I/O error during system call, Connection timed out
09-22 09:46:11.235 D/GmsGcmTrigger(2471): Ignoring Intent { act=org.microg.gms.gcm.RECONNECT flg=0x10 cmp=com.google.android.gms/org.microg.gms.gcm.TriggerReceiver }: network is offline
09-22 09:46:14.075 D/GmsGcmMcsSvc(2471): Connect initiated, reason: Intent { act=org.microg.gms.gcm.mcs.CONNECT cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:46:14.075 D/GmsGcmMcsSvc(2471): Starting MCS connection...
09-22 09:46:14.200 W/GmsGcmMcsSvc(2471): Exception while connecting!
09-22 09:46:14.200 D/GmsGcmMcsSvc(2471): Teardown initiated, reason: java.net.UnknownHostException: Unable to resolve host "mtalk.google.com": No address associated with hostname
09-22 09:46:26.650 D/GmsGcmMcsSvc(2471): Connect initiated, reason: Intent { act=org.microg.gms.gcm.mcs.CONNECT cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:46:26.650 D/GmsGcmMcsSvc(2471): Starting MCS connection...
09-22 09:46:26.765 W/GmsGcmMcsSvc(2471): Exception while connecting!
09-22 09:46:26.765 D/GmsGcmMcsSvc(2471): Teardown initiated, reason: java.net.UnknownHostException: Unable to resolve host "mtalk.google.com": No address associated with hostname
09-22 09:46:27.700 D/GmsGcmMcsSvc(2471): Connect initiated, reason: Intent { act=org.microg.gms.gcm.mcs.CONNECT cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
09-22 09:46:27.700 D/GmsGcmMcsSvc(2471): Starting MCS connection...
09-22 09:46:27.705 W/GmsGcmMcsSvc(2471): Exception while connecting!
09-22 09:46:27.705 D/GmsGcmMcsSvc(2471): Teardown initiated, reason: java.net.UnknownHostException: Unable to resolve host "mtalk.google.com": No address associated with hostname
09-22 09:46:27.710 I/ActivityManager(2253): Delay finish: com.google.android.gms/org.microg.gms.gcm.TriggerReceiver
09-22 14:54:51.055 W/ActivityManager(2253): Scheduling restart of crashed service org.thoughtcrime.redphone/.gcm.GCMRegistrationService in 1000ms
09-22 14:54:52.280 I/ActivityManager(2253): Start proc org.thoughtcrime.redphone for service org.thoughtcrime.redphone/.gcm.GCMRegistrationService: pid=27892 uid=10196 gids={50196, 1028, 1015, 1023, 3003, 3002}

@bonanza123
Copy link

is it possible that at this point the internet connection was lost? Were you connected via mobile internet or WiFi?

@jensMF
Copy link

jensMF commented Sep 22, 2015

I think it could be a problem with my DNS. I was connected via wifi. But it did not reconnect when the DNS was working again.

@jensMF
Copy link

jensMF commented Oct 2, 2015

Hey there,
it works for long times for me with 5.1.1, thats why I did not comment for long time, but I put on the airplane mode last night and when I put it off gcm did not reconnect. So the problem seems to be that it does not reconnect if there is no internet access for too long.

@bonanza123
Copy link

I can confirm the issue with flight mode. I guess my wish concerning "reconnect on connectivity change" would solve this problem as well.

mar-v-in added a commit that referenced this issue Oct 3, 2015
- Update Location APIs, fixes #37
- Update version number, fixes #38
- Enable long press input on WebView during login, fixes #34
- Extended log output and auto-repair for GCM connection, related to #29 and #31
- New icons
- Small quirks in Auth handling (required for Login to some applications)
mar-v-in added a commit that referenced this issue Oct 11, 2015
- Fix bug causing unregister to be send multiple times
- More work related to #23, #29 and #31
@mar-v-in mar-v-in changed the title Push messaging not processed unless application is in foreground Issues with push messages (service hanging until reboot / messages not processed) Oct 15, 2015
@mar-v-in
Copy link
Member

This issue should be mostly done with 766a6a1. For nightly/git users: if problems persist, please report back here.

@Tentos
Copy link

Tentos commented Oct 20, 2015

After the installation of GsfProxy, Threema crashes when it receives a c2dm.intent.RECEIVE, i.e. a notification by GmsCore. The main difference after the installation of GsfProxy seems that Threema is no longer permanently running in the background: its messaging service is inactive, and the app simply waits to be waked up by GCM.
The logcat:

10-20 16:10:35.843 E/Threema (17532): java.lang.RuntimeException: Unable to start receiver ch.threema.app.receivers.GcmBroadcastReceiver: java.lang.NullPointerException
10-20 16:10:35.903 E/AndroidRuntime(17532): FATAL EXCEPTION: main
10-20 16:10:35.903 E/AndroidRuntime(17532): java.lang.RuntimeException: Unable to start receiver ch.threema.app.receivers.GcmBroadcastReceiver: java.lang.NullPointerException
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2520)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.app.ActivityThread.handleReceiver(Native Method)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.app.ActivityThread.access$1500(ActivityThread.java:156)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1416)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.os.Looper.loop(Looper.java:153)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.app.ActivityThread.main(ActivityThread.java:5299)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at java.lang.reflect.Method.invokeNative(Native Method)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at java.lang.reflect.Method.invoke(Method.java:511)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at dalvik.system.NativeStart.main(Native Method)
10-20 16:10:35.903 E/AndroidRuntime(17532): Caused by: java.lang.NullPointerException
10-20 16:10:35.903 E/AndroidRuntime(17532):     at ch.threema.app.receivers.GcmBroadcastReceiver.onReceive(SourceFile:34)
10-20 16:10:35.903 E/AndroidRuntime(17532):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2513)
10-20 16:10:35.903 E/AndroidRuntime(17532):     ... 14 more
10-20 16:10:35.935 E/AppErrorDialog(573): Failed to get ILowStorageHandle instance
10-20 16:10:43.799 D/libc-netbsd(126): getaddrinfo: reports.crashlytics.com NO result from proxy 
10-20 16:10:43.800 D/libc-netbsd(126): res_queryN name = reports.crashlytics.com, class = 1, type = 1
10-20 16:10:43.831 D/libc-netbsd(126): res_queryN name = reports.crashlytics.com succeed
10-20 16:10:43.860 D/libc-netbsd(869): getaddrinfo: reports.crashlytics.com get result from proxy >>
10-20 16:10:43.923 E/Crashlytics(869): Error occurred sending report com.crashlytics.android.Z@41a8a090

Reading the logcat, I am not sure whether GMS core is really responsible for the problem. It may be a Threema bug? It should also be noted that I have restricted parts of Threema with XPrivacy, so this may be the reason for the crash. (On the other hand, the only activity XPrivacy has listed when Threema received the c2dm.intent.RECEIVE was in fact c2dm.intent.RECEIVE.)

@julienschmidt
Copy link
Contributor

Did you reinstall Threema after installing GsfProxy?

@Tentos
Copy link

Tentos commented Oct 20, 2015

I did a re-install without deinstalling it. I will try a proper re-install.

@Tentos
Copy link

Tentos commented Oct 20, 2015

Unfortunately, it still crashes. As far as I can tell, the logcat is still the same as above.

@mar-v-in
Copy link
Member

Looking through the exception stack trace, this seems not to be related to GmsCore, however, as Threema is obfuscated non-free software, one can't say for sure. Can you try to disable XPrivacy for Threema?

@Tentos
Copy link

Tentos commented Oct 20, 2015

I have deactivated XPrivacy for Threema, and the crash still occurs. Since the installation of GsfProxy coincided with the release of a new Threema sub-version, this may be a bug of Threema that happens in my constellation. I will also take a look at the internal Threema log.

@mar-v-in
Copy link
Member

Thanks for the note on the Threema update. Threema 2.52 does not work with GmsCore right now, as they use some undocumented feature of the deprecated C2DM API. Threema 2.51 should still work. I will provide a fix for the problem soon.

@Tentos
Copy link

Tentos commented Oct 20, 2015

Excellent, @mar-v-in . 2.51 worked without problems, but I also had not GsfProxy installed. I will see how Threema 2.51 behaves with GsfProxy and GmsCore both installed.

@Tentos
Copy link

Tentos commented Oct 20, 2015

It seems that @mar-v-in is right: 2.51 seems to work with both GsfProxy and GmsCore installed.
EDIT: I could finally check it, the newest version of GmsCore works with Threema. Thank you @mar-v-in !

@mar-v-in mar-v-in added this to the v0.02 milestone Oct 29, 2015
@pejakm pejakm mentioned this issue Nov 1, 2015
mar-v-in added a commit that referenced this issue Jan 12, 2016
@IzzySoft
Copy link

Until the new version (v0.02 I guess – any estimate when it's due?) is released: what are known actions to revive GCM?

  • reboot (solved it 100% for me, but is not the preferred action)
  • dialing *#*#CHECKIN#*#* (as mentioned in gms checkin expires #23 – is this a reliable fix? can it be automated e.g. via Tasker? if so, does it hurt to simply run it e.g. once per hour/day via automated task?)
  • other options? (e.g. force-stop/restart the responsible process (which? how to?))
  • is it recommended to use one of those "Push Notifications Fixer" apps – and if so, which one(s)? Any side-effects to expect from those?

Apart from that: is there a way for non-devs (like me) to get hold of the "current dev APK" – something like a "nightly/weekly build"? That way we might help confirming whether a certain bug/misbehavior/other_strange_thing (count me in with this one, happens to me about once per week) was fixed or is having other side-effects.

@julienschmidt
Copy link
Contributor

@SWW13 provides automated builds here: http://files.brnmod.rocks/apps/GmsCore/Latest/

@mar-v-in
Copy link
Member

v0.02 will be published soon (maybe next week) and I will start to provide "official" signed builds on a regular base afterwards (including updates through a f-droid repository)

@IzzySoft
Copy link

Thanks @julienschmidt – and of course @mar-v-in ! With that announcement, I guess I'll wait that little time and go with the official builds (they'll be more frequent then I take it?) due to signature and automatic updates (F-Droid). Looking forward to that announcement :)

@mar-v-in might be useful to link those automated builds from the README.md? And if I understood you correctly, you'll setup a separate repo for this "dev branch". I'll happily include it in my list of F-Droid Repos 😺

mar-v-in added a commit that referenced this issue Jan 27, 2016
- Update build tools
- Update sublibs
- Add proper PlacePicker, fixes #65
- Add selfcheck
- Improvements to MCS connection, related #31 #54
- Do not crash when permission to GPS is not granted
- Various smaller fixes
@Tentos
Copy link

Tentos commented Jan 27, 2016

Since the upgrade to Threema 2.6, there seems to be again an issue with GCM. I am not sure whether this is (again) related to some undocumented command of GCM/C2DM that Threema uses or to a bug in Threema itself. (In the latter, maybe a version 2.61 will fix this. Note that I have indeed seen some reports about Push problems with Threema 2.6 and the official Google Play Services, but they may or may not be related to my problem. The general userbase does not seem to have any major problems.)

The problem: Threema no longer seems to be able to register at the GCM service (com.google.android.c2dm.intent.REGISTRATION) nor does it receive any messages (com.google.android.c2dm.intent.RECEIVE - this is probably related to the failed registration).

Threema offers the possibility to force a new REGISTRATION action ("Reset push token", see https://threema.ch/en/faq/push_andr ). The Threema log of Version 2.53 then reports:

Wed Jan 27 13:46:16 MEZ 2016     acquireConnection: source = activityResumed, refCount = 1
Wed Jan 27 13:46:17 MEZ 2016    GCM register forced.
Wed Jan 27 13:46:17 MEZ 2016    GCM register in background.
Wed Jan 27 13:46:18 MEZ 2016     GCM registered, token = APA***E
Wed Jan 27 13:46:18 MEZ 2016    Sent push token to server.
Wed Jan 27 13:46:20 MEZ 2016     releaseConnectionLinger: source = activityPaused, timeout = 60000
Wed Jan 27 13:46:20 MEZ 2016    releaseConnection: source = activityPaused, refCount = 0
Wed Jan 27 13:46:20 MEZ 2016    onTrimMemory: 20

XPrivacy shows that a REGISTRATION was executed, and the logcat (captured with catlog) shows that GMS Core connected to the Google push server. Receiving messages works as expected.

This does not happen with version 2.6. The Threema log only shows

Wed Jan 27 11:54:50 MEZ 2016    acquireConnection: source = activityResumed, refCount = 1
Wed Jan 27 11:54:51 MEZ 2016     GCM Registration Token: APA***E
Wed Jan 27 11:54:53 MEZ 2016     releaseConnectionLinger: source = activityPaused, timeout = 60000
Wed Jan 27 11:54:53 MEZ 2016    releaseConnection: source = activityPaused, refCount = 0
Wed Jan 27 11:54:53 MEZ 2016    onTrimMemory: 20

XPrivacy does not show a REGISTRATION action, and the logcat does not show anything either (not even an error).

The only REGISTRATION that seems to happen is after the installation of Threema 2.6 (which is also intercepted - and allowed - by XPrivacy). It does not seem to have any effect because push messages do not arrive. (As mentioned, resetting the push token should again lead to a new REGISTRATION, which does not happen.)

I am aware that this description (with a logcat that does not show anything special...) does not really help. To begin, I therefore can only ask:
Does anyone use Threema 2.6 with the newest version of GMS Core, and it works?

Should a developer want to look into this and not have a Threema licence, just send me a message, I will gladly sponsor one.

To conclude, my system:
Android 4.2.2
Version 0.2.0 of GMS Core (downloaded at http://files.brnmod.rocks/apps/GmsCore/Latest)
Signature spoofing with the FakeGapps Xposed module
Push works with WhatsApp & Push Notification Tester

EDIT: I have (finally) installed the tools to capture logcats via USB. As I am a noob, I will have to find out how I can capture more or useful information. Or does anyone know how to capture the information specifically of GMS Core?

2nd EDIT: I must do something wrong, the logcat does not show any information with entries like "GmsGcmMcsSvc." Have I to set GMS Core to a "verbose" mode or something similar?

@IzzySoft
Copy link

IzzySoft commented Feb 1, 2016

Just a little feedback: Heartbeat was just dead again here (still with the 0.01 of GmsCore installed). Did an adb install -r for the 0.2.0, immediately got a lot of noise (all the missed notifications came up at once and were immediately dismissed as already noticed elsewhere), and the heart started beating again – no reboot required at all :) Will watch this a little longer, but that looks very promising. 👍

@Tentos
Copy link

Tentos commented Feb 6, 2016

Threema has been updated to 2.61. The good news is that the app now gets a com.google.android.c2dm.intent.RECEIVE if a new message has been sent to me. Unfortunately, Threema does not seem to process this, i.e. the app does nothing. Moreover, the manual renewal of the push registration token (i.e. the triggering of a com.google.android.c2dm.intent.REGISTER action) still does not seem to work (with the possible exception once after the installation of the update).
I will have to further look into this, but my logcat still does not contain anything special (at least if viewed with catlog).
EDIT: Could this now be the same error as in #75?

@xsmile
Copy link

xsmile commented Feb 27, 2016

Using 6.0.1 and the current nightlies installed as system apps.

This time the heartbeat wasn't issued for several hours until I opened WhatsApp.
Here is the log: http://hastebin.com/oyoyugeyup.avrasm.

This issue might be connected to #100.

@mar-v-in
Copy link
Member

@xsmile answered in #100. This is very likely related.
@Tentos Please create a separate issue for Threema if the problem still persists with log output

Everyone having issues with push notifications on Android 6.0: Please ensure that "Battery optimization" is disabled for microG Services Core in System Settings -> Battery -> Menu -> Battery optimization. Note that this is the case for original Play Services as it is required to keep a stable background connection.

As far as I can tell from now, problems with GCM do not occur widely and/or are specific to certain apps and custom ROMs. I am closing this issue now. If you encounter a similar issue, please create a separate issue with all details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants