corona-warn-app / cwa-app-android

Native Android app using the Apple/Google exposure notification API. The CWA development ends on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
2.44k stars 496 forks source link

Exposure logging is not possible / Exposure logging active due to Background Job being killed from Manufacturer Battery Optimisation #637

Closed mueslo closed 4 years ago

mueslo commented 4 years ago

Describe the bug

Status bar below the title bar tells me "EXPOSURE LOGGING ACTIVE". The main content of the app tells me

Exposure logging is not possible. Your exposure logging could not be updated for more than 24 hours. Updated: 16 Jun, 11:30. ACTIVATE EXPOSURE LOGGING

Pressing on ACTIVATE EXPOSURE LOGGING brings me to a screen which tells me Exposure Logging is already active. (checkbox is set to 'Active', subtext says "Exposure logging has been active for 2 days. [...]". I also tried disabling and re-enabling it.

Going back to the main screen (or killing the app and reopening it) yields the same state.

When initially installing it on Tuesday, 16.06. it seemed to work fine (Unsure about version, possibly 1.0.0?) and on Wednesday gave me a status of "Low Risk", so it seemed to be working. Yesterday afternoon I also updated to 1.0.2 via Google Play Store. However, I cannot tell if it is really due to the updated version or some other cause.

Expected behaviour

Exposure logging works or consistently tells me it doesn't work and for what reason. I'm getting mixed signals here.

Steps to reproduce the issue

Screenshots are disabled in the app.

Technical details

Additional context

Bluetooth and location services are enabled. The phone supports BLE.


Internal Tracking ID: EXPOSUREAPP-1592

mbw83 commented 4 years ago

Mine is again not updating. It still says that it was updated the day before yesterday, but it think this afternoon it will turn again to "Risk calculation not possible". I think this bug is also related to #621.

Hi @marcmuschko, would it be possible to say what the problem is in a few words and reference the branch (if public) that you are working on? It's nice for the community to be in the loop and not just get notified once the fix is rolled out.

@marcmuschko would it be possible to give a small update? For me it must not be the branch, just a short status update would be good. This would also prevent, these weird things going on here in this thread. As far as I understand, the big advantage of using the Google/Apple API is, that the app doesn't have to be running the whole day, just because the logging is made by the API. The only thing the app has to do is to download the infected keys from a server every 24 hours. So why setting some settings in regard to autostart or battery saving? Nevertheless, even my instant messaging and email apps are able to work without setting these options.

FraumitKlasse commented 4 years ago

I've been successfully by using Einstellungen (settings) --> Akku (battery?) --> App-Start --> Corona-Warn --> Manuell verwalten (manage manually?) --> turned of every button manually --> turned on every button manually --> restarted my mobile --> repeated a fiew times Today in the morning the app looks like working.

I't would be fine to fix the bug, some people I know would have given up yet.

Thanks!

Have you tried it with setting the app on autostart? FraumitKlasse notifications@github.com schrieb am Fr., 19. Juni 2020, 23:08: Same problem with my huawei p20 pro. Bugfix haevn't worked yet. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#637 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAL4XSN3WIAAIWAJJC5IX3RXPHVLANCNFSM4OBP5J5A .

Aim23 commented 4 years ago

Having the same issue on a honor 9 (SFT-L09) smartphone. None of the "Tipps and Tricks" above worked so far.

towo commented 4 years ago

I've got a case here with a HUAWEI P smart (2018) that's showing the same problems; I've just deactivated the startup management, but it at least didn't lead to an immediate update. Software versions are current.

Maybe have a (rate limited) force update button, to circumvent that the app is only doing an update every 24h or so?

casore735 commented 4 years ago

Same issue with Galaxy A3 (2017) and Android version 8.

florianj1 commented 4 years ago

At first, my risk level was not updated as described in #621, thus I turned off energy saving (Switch "Energiesparmodus" to "Keine Beschränkungen"). 48 hours after last update I received a new one, but a few hours later my risk level changed to unknown and the situation became as described by @mueslo in this issue. After restarting my phone for approximately 5 times the risk level is back again.

wende60 commented 4 years ago

Same here, Huawei P10, Android 9, active since 4 days but no status update. Already did set permissions in App-Start to manual management, but did not know that i should restart. Will see if restart will fix the issue now... UPDATE: restart after settings-change does the job, so for now it is working. Took some additional time after restart though... So again (German menu) Akku - App-Start: set Corona-app to 'manuell verwalten' (all options on) and restart.

potofcoffee commented 4 years ago

Same here Huawei P20 lite, all automatic energy-management settings disabled for CWA. Sayys "Risiko-Ermittlung aktiv" and then "Risiko-Ermittlung nicht möglich: Ihre Risiko-Ermittlung konnte seit mehr als 24 Stunden nicht aktualisiert werden."

tombied commented 4 years ago

das selbe Problem seit heute auf mein Huawei P30 Pro.. keine Aktualisierung möglich trotz eingeschalteter Risikoüberwachung..

Claudi801 commented 4 years ago

Same Problem with Huawei P20

martinhd commented 4 years ago

Same on my Honor 10 with Android 9 (Kernel 4.9.148) Was working initially, but not any longer.....

birgit-xy commented 4 years ago

Von: martinhd [mailto:notifications@github.com] Gesendet: Samstag, 20. Juni 2020 18:13 An: corona-warn-app/cwa-app-android Cc: birgit-xy; Mention Betreff: Re: [corona-warn-app/cwa-app-android] Exposure logging is not possible / Exposure logging active (#637)

Same on my Honor 10 with Android 9 (Kernel 4.9.148) Was working initially, but not any longer.....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/corona-warn-app/cwa-app-android/issues/637#issuecomment-647014986 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAMM7FTMWZ5A2GFOKHLQZTRXTNZ5ANCNFSM4OBP5J5A . https://github.com/notifications/beacon/AQAMM7A543JXCXT557SOTW3RXTNZ5A5CNFSM4OBP5J5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2IKUSQ.gif

cant-think-of-aname commented 4 years ago

Same issue here with an Honor 8x with Android 10 and latest SW and security patches installed. Installed the app right after it was released on Tuesday, it worked as intented first and showed me a green status on Wednesday, on Thursday it said exposure logging was not working. Restart of the app or phone did not work, updating the app in the play store neither. I ended up uninstalling and reinstalling the app. It worked on Friday, but today on Saturday it was the same again. Seems it works for 2 days (48 hours?) and then stops. Will try to change battery saving settings for the app and see if that makes a difference, but the issue should be solved for non tech savvy users.

mueslo commented 4 years ago

I have now had battery saver disabled and autostart enabled for around a day, and the bug remains.

Edit: Disabling battery savings and autostart was not enough, but after a restart, it seems it updates properly every day now.

aWeinzierl commented 4 years ago

Same problem:

Exposure Logging is not possible Your exposure logging could not be udpated for more than 24 hours. Last exposure logging: Low Risk Updated 17 Jun, xx:xx

Click on:

Activate Exposure Logging

Exposure Logging Active( *) Exposure logging has been active for 4 days. An exposure check can only be reliable if exposure logging is permanently activated.

When I go back, I see the same. Disabling battery saver did not help. Reactivating GPS, Bluetooth, and settings in the app did not help.

Version 1.0.2 Releasd on 12 Jun 2020 Android 7.1.2 N2G47H MIUI version MIUI Global 11.0.2 | Stable 11.0.2.0(NAMMIXM) Xiaomi Redmi 4X

gbrehmer commented 4 years ago

Have the same issue with Huawei Mate 20 Pro (installed since tuesday, info widget that risk calculation is inactive, please activate, but on second screen is still active (since 2 days)). Probably caused by the battery settings for the app. I have reinstalled the app and deactivated auto settings. I will report tomorrow

fixed by changing app battery settings (disable auto mode and leave the sub-settings unchanged = all active). But after that it takes up to 24 hours for the error to go away

matheis commented 4 years ago

fixed by changing app battery settings (disable auto mode and leave the sub-settings unchanged = all active). But after that it takes up to 24 hours for the error to go away

Yes, I can confirm this. Disable auto and keep the then shown settings does the trick. I use an Honor 8X with Android 10. Just to mention it: It seems to me that Honor (and most likely Huawei, i.e. their EMUI) have these strict battery saving settings. Does anyone know if this feature of rigid battery saving options is EMUI specific? Reading the thread here one could get this impression. BTW: I needed to do set manual battery settings also for Threema and Podcast Addict. Unfortunately I don't remember exactly, what kind of problem exactly I had with these apps. For Threema I can remeber, that I was not notified about newly received messages correctly/in time.

BenMaierEU commented 4 years ago

To whom it may concern. I have the same issue. Opened the app and the "Exposure Logging not possible" screen is displayed. When I click on "Activate Exposure Logging" I get send to the activation menu in which the exposure Logging toggle is activated. Setting it off then on does not solve the issue.

Device: Xiaomi Mi 9T Pro No battery optimization setting enabled.

edit: what I now see is that I did not toggle on the "autostart" feature in Xiaomi miui which prevents apps to start during system startup and run in background. I will now switch the feature on and report back if the error persists.

gbhajda commented 4 years ago

Gleiches Problem mit Samsung Galaxy M20, Android 10

Benwick91 commented 4 years ago

Same issue on Xiaomi Redmi Note 7. None of the fixes with Autostart or Akku - App-Energiesparen work for me.

mmlea commented 4 years ago

Huawei PSmart FIG - LX 1 (Google Services enabled Auto start Change from Automatic to manual and back, restart made ,no battery saving enabled)....what may be interesting that from from 17.6. to 19.6. it worked and showed low risk and now ( letzte Aktualisierung 18.6. 18:06) since I assume yesterday it went back to Risikoermittlung nicht möglich and none of the suggested changes in settings ( Autostart enabled manually and back to automatic / Google Services running, no Accu saving ) gets Risikoermittlung back to work.How can sb know when the problem is solved ...will the app work again by itself or will updates / restart s be necessary ....and if yes where will this info be available. Edit 22.6. 12;00 it is working again and tells me aktualisiert heute 11.18 h ( which is 2,5 days after the last actualization)Thank you VG

doganoo commented 4 years ago

having the same issue with an iPhone XR. The app showed me a "low risk" notification the first day. Since then it is showing "exposure logging is not possible". Tried app and phone restarting as well as revoking and granting exposure logging permissions

BenMaierEU commented 4 years ago

To whom it may concern. I have the same issue. Opened the app and the "Exposure Logging not possible" screen is displayed. When I click on "Activate Exposure Logging" I get send to the activation menu in which the exposure Logging toggle is activated. Setting it off then on does not solve the issue.

Device: Xiaomi Mi 9T Pro No battery optimization setting enabled.

edit: what I now see is that I did not toggle on the "autostart" feature in Xiaomi miui which prevents apps to start during system startup and run in background. I will now switch the feature on and report back if the error persists.

My error has now gone and my state returned to the nominal state "Low Risk".I will continue monitor, if the error reappears.

My working assumption is that my xiaomis "autostart" feature closed the app on system start (restart) so that the Bluetooth connections weren't monitored. After I enabled "Autostart" and the app, the app required some more logging time to return to the default "Low Risk" state.

2nd possiblility: Maybe the error is connected with the recent update closing the application and interrupting the logging (together with disabled "autostart")

Kimtinki commented 4 years ago

Same in Samsung Galaxy A3 (2017)

tkowark commented 4 years ago

In the meantime, the team identified a workaround that solved the problem at least for some users: https://www.coronawarn.app/de/faq/#no_risk_update. Would be great if you can let us know whether it worked for you as well.

Of course, the team is nevertheless still working on a proper solution for the issue.

alxy commented 4 years ago

Unfortunatly, the generic workaround has not worked for me. After restarting my phone (Huawei P30) and opening the CWA the problem still persists.

EACourts commented 4 years ago

The workaround hasn't worked for me either Xiaomi Mi 9/MIUI 11.0.9

BenMaierEU commented 4 years ago

@alxy Just to be sure. if you disable the battery saver mode after receiving the error. Make sure to wait a day until the logging has received enough data to trigger the low risk status. Disableing batter saver mode doesn't instantly triggers the low risk status.

That confused me initially when I applied the error fix. But it makes sense given how the functionality works.

I guess most people know that. But just to be safe.

mbw83 commented 4 years ago

In the meantime, the team identified a workaround that solved the problem at least for some users: https://www.coronawarn.app/de/faq/#no_risk_update. Would be great if you can let us know whether it worked for you as well.

Of course, the team is nevertheless still working on a proper solution for the issue.

I still can not see the point, why setting this (weird) options should help solving the problem. As pointed out by @mh- in this thread of the cwa-documentation#236 three attemps within 1 minute are done to get the data from the server. If this fails (this can also be because the internet is not available), the next attempt will be done 24 hours later. And as I also said before, my messaging (Signal, Telegram, WhatsApp, ...) and eMail (K-9 Mail, GMail, ...) apps are also able to retrieve the data on my phone without adjusting any energy options.

I do not want to offend anybody, I'm just trying to understand why this should help.

alxy commented 4 years ago

@alxy Just to be sure. if you disable the battery saver mode after receiving the error. Make sure to wait a day until the logging has received enough data to trigger the low risk status. Disableing batter saver mode doesn't instantly triggers the low risk status.

That confused me initially when I applied the error fix. But it makes sense given how the functionality works.

I guess most people know that. But just to be safe.

I indeed wasn't aware of this. I will see if the problem is gone tomorrow then and report if that is the case. For the FAQ I thnik it would make sense to clearly mention that it takes some time for the app to go back to green status again. As said, I expected it to work immediatly, as the last step in the FAQ workaround is to open the CWA.

Edit: I just reopened the app and can confirm it is working now! So the workaround worked for me.

BenMaierEU commented 4 years ago

@alxy Just to be sure. if you disable the battery saver mode after receiving the error. Make sure to wait a day until the logging has received enough data to trigger the low risk status. Disableing batter saver mode doesn't instantly triggers the low risk status. That confused me initially when I applied the error fix. But it makes sense given how the functionality works. I guess most people know that. But just to be safe.

I indeed wasn't aware of this. I will see if the problem is gone tomorrow then and report if that is the case. For the FAQ I thnik it would make sense to clearly mention that it takes some time for the app to go back to green status again. As said, I expected it to work immediatly, as the last step in the FAQ workaround is to open the CWA.

Edit: I just reopened the app and can confirm it is working now! So the workaround worked for me.

Ok great to here. I am obviously not 100% sure how all the functions work. So not 100% sure about the 24hrs . :) But what I think is definitely reasonable for people is to wait at least a while after applying the bug fix. If it didnt't work immediately after applying the bug fix, one can't assume the bug fix didn't work. :)

But happy to be corrected by the developers.

r5r3 commented 4 years ago

Auf dem Samsung A3 2017 funktioniert für mich folgendes:

Einstellungen => Apps => Corona-Warn => Akku => Akkuverbrauch optimieren => Alle Apps => Corona-Warn deaktivieren.

Nach dem Ändern dieser Einstellung wurde direkt wieder ein Risiko angezeigt. Davor ging es zwei Tage lang nicht.

Alistro178 commented 4 years ago

The same Problem with Honor 8x.

leholz commented 4 years ago

Same problem here with Huawei Mate 10 Pro (device already mentioned). Also thought deactivating battery save functions for corona warn might help but this doesnt resolved the issue for me. Some days ago my phone was updatet to Android 10. I'm unsure if the update to EMUI 10 was installed right before i first had the issue described above.

Is the function of receiving and sending tokens affected by this issue?

Thanks

Discostu36 commented 4 years ago

And as I also said before, my messaging (Signal, Telegram, WhatsApp, ...) and eMail (K-9 Mail, GMail, ...) apps are also able to retrieve the data on my phone without adjusting any energy options.

These apps are most likely using push notification services while CWA is not. The server is not pushing the list, the app is asking for it (at least that's how it was explained in UKW podcast).

Like others before me I'd like to ask the developers for more information about this issue:

drillabit commented 4 years ago

Similar problem on Samsung A3 2017 Android 9. No Risk-Update since 18.6.2020 7:48. Shows button to enable Risk-Assessment, but when clicked, shows the enable switch in on position. Today i had the app open around update time, did not fix it. Have no power saving enabled, excempted CWA from data-volume or power limitations. I am almost always in a Wifi at update time.

cschoenle commented 4 years ago

I had the same problem on Samsung Galaxy S10+. However, found that an update was available in Google Play store (from 20 June, had apparently not updated automatically), and now the issue is gone and everything working again.

janfreymann commented 4 years ago

Related to https://www.coronawarn.app/en/faq/#no_risk_update

Afaik it is possible to show a dialog to the user to disable battery optimization: https://developer.android.com/reference/android/provider/Settings.html#ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS

However, the setting does not "help" with vendor-specific battery optimizers.

gbhajda commented 4 years ago

Auf Basis der bisherigen Tipps habe ich es jetzt auch für mein Samsung M20 die Möglichkeit gefunden, die Corona App wieder zum Laufen zu bringen: Einstellungen => Gerätewartung => Akku =>Energieverwaltung von Apps Dort gibt es einen pauschal wirkenden Schalter „Standby für nicht verwendete Apps“, der bei mir gesetzt war; darunter gibt es dann eine Auflistung von Apps im Standby, und nachdem ich die Corona Warn App explizit auf „Nicht in Standby versetzen“ gestellt hatte und das Gerät neu gestartet habe läuft jetzt alles problemlos und aktualisiert auch.

Von: Robert Redl [mailto:notifications@github.com] Gesendet: Sonntag, 21. Juni 2020 18:08 An: corona-warn-app/cwa-app-android Cc: gbhajda; Comment Betreff: Re: [corona-warn-app/cwa-app-android] Exposure logging is not possible / Exposure logging active (#637)

Auf dem Samsung A3 2017 funktioniert für mich folgendes:

Einstellungen => Apps => Corona-Warn => Akku => Akkuverbrauch optimieren => Alle Apps => Corona-Warn deaktivieren.

Nach dem Ändern dieser Einstellung wurde direkt wieder ein Risiko angezeigt. Davor ging es zwei Tage lang nicht.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/corona-warn-app/cwa-app-android/issues/637#issuecomment-647147439 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQA3WLI53EGTQ3HUQNCSOELRXYV6DANCNFSM4OBP5J5A . https://github.com/notifications/beacon/AQA3WLIBM3PUONIDHWWCNZTRXYV6DA5CNFSM4OBP5J5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2JK7LY.gif

m6100 commented 4 years ago

It exists an unresolved Android bug for this issue that is being ignored by Google for more than 1.5 Years now: https://issuetracker.google.com/issues/122098785 Please see also: https://dontkillmyapp.com/

jheinitz commented 4 years ago

Hi,

I'm facing the same issue. I'm using a Huawei P30 Pro. Please let me know if you need more details.

Kind regards Jens

drillabit commented 4 years ago

cschoenle wrote:

I had the same problem on Samsung Galaxy S10+. However, found that an update was available in Google Play store (from 20 June, had apparently not updated automatically), and now the issue is gone and everything working again.

Found this update today, didn't install automatically on my phone, but did the trick after installing it manually! Thanks to cschoenle! Thanks to all the other people, but the app was already exempted from Standby! That did not help in my case, but may be its needed... who knows...

casore735 commented 4 years ago

Samsung Galaxy A3 (2017) with android 8: I tried all the workarounds with the battery standby mode and disabling the optimization, update to version 1.0.2, none of this worked. I now manually updated the app to the latest version 1.0.4 (the app did not update automtically), and now it's working again.

gbrehmer commented 4 years ago

I now manually updated the app to the latest version 1.0.4 (the app did not update automatically), and now it's working again.

Probably because with 1.0.3+ the app is getting updates also on app start (https://github.com/corona-warn-app/cwa-app-android/pull/660). It's possible that the problem still exists, if the app is not opened manually. Does anyone know which downsides this approach has?

Kimtinki commented 4 years ago

In the meantime, the team identified a workaround that solved the problem at least for some users: https://www.coronawarn.app/de/faq/#no_risk_update. Would be great if you can let us know whether it worked for you as well. Of course, the team is nevertheless still working on a proper solution for the issue.

to Change the battery Settings didn't work for me. Today I had the Chance to update the app to the newest Version, it was not possible before, now the app works again

holgerman commented 4 years ago

Same on Samsung Galaxy Note 9 Workaround not relevant for Note 9 Android 10, as settings have different names, tried to adapt the workflow as shown below, but this did not work either...bug remains Öffne die Geräte-Einstellungen. Wähle 'Apps' bzw. 'Apps & Benachrichtigungen'. Wähle 'Corona-Warn'. Wähle 'Akkuverbrauch optimieren'. Wahle alle Wähle 'Corona-Warn'. --> umstellen, dass optimieren NICHT mehr gewaehlt ist Neustart

Jo-Achim commented 4 years ago

[Info:] „Risiko-Ermittlung nicht möglich“ und „Risiko-Ermittlung einschalten“ bei „Risiko-Ermittlung Aktiv“… "Android one - Nokia 7.1", Android 10 mit Sicherheitspatch vom 01. Mai 2020, CWA 1.0.4.

Scheinbar verhindert die eingeschaltete Option „Datensparer“ die korrekte Risiko-Ermittlung. Nach Ausschalten der Option „Datensparer“ und erneutem Aufruf der CWA funktioniert die Risikoermittlung wieder; d.h. das ermittelte Risiko wird angezeigt.


[Info:] "Risk determination not possible" and "Activate risk determination" when "Risk determination active" ... "Android one - Nokia 7.1", Android 10 with security patch from May 1st 2020, CWA 1.0.4.

Apparently the activated option "Data saver" („Datensparer“) prevents the correct risk determination. After switching off the "Data saver" („Datensparer“) option and opening the CWA again, the risk determination works again; i.e. the determined risk is displayed.

svengabr commented 4 years ago

Fix for iPhone users (I am using iPhone XS Max)

  1. Go to "Settings"
  2. Go to "General"
  3. Go to "Background App Refresh"
  4. Turn "Background App Refresh" on
  5. Find the Corona-Warn App in the list and enable Background App Refresh
  6. Restart Corona-Warn App
  7. It will work now
FabianFalck commented 4 years ago

I confirm that @svengabr 's comment fixes the issue for iPhone users. I had this issue since day one when the app was released; it rendered the app useless for me and it wasn't fixed until now (I have the latest version of the app). The average user would not attempt to find a solution for this issue here on Github. This requires an immediate fix with a warning message that redirects to the correct settings menu (as detailed above), if background app refresh is disabled. Currently, the warning message redirects to the general app settings, where background app refresh is enabled, but greyed out, since the global background app refresh was turned off. This is misleading.

daimpi commented 4 years ago

@FabianFalck agreed. I see quite a few users still experiencing this issue. It seems to get tracked here currently btw 🙂.