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 495 forks source link

App closing immediately on start #1053

Closed FriederikeHanssen closed 3 years ago

FriederikeHanssen commented 4 years ago

Avoid duplicates

Describe the bug

Since a couple of days the app closes immediately after opening it.

Expected behaviour

App opening.

Steps to reproduce the issue

Open the app.

Technical details

Possible Fix

Additional context

Until now, it has worked as expected. Restarted the phone multiple times and checked that the App is part of the protected background apps. App version: 1.2.1


Internal Tracking ID: EXPOSUREAPP-2249, EXPOSUREAPP-1851

MikeMcC399 commented 4 years ago

This may be related to Error Reason: 2001; App does not work anymore https://github.com/corona-warn-app/cwa-app-android/issues/968

The mobile device Huawei P8 Android 6.0 is specifically mentioned in https://github.com/corona-warn-app/cwa-app-android/issues/968#issuecomment-668580779

MikeMcC399 commented 4 years ago

@helmutweick also described a similar issue in https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678277274 for Huawei H60-40 Android 6.0.

vaubaehn commented 4 years ago

@helmutweick also described a similar issue in #642 (comment) for Huawei H60-40 Android 6.0.

Yes, and I think @helmutweick 's amazing logcat stacktraces are pointing to one Huawei specific issue that might be associated with this problem: Huawei Analytics! Unfortunately, many Android apps seem to struggle with NullPointerExceptions in com.huawei.lcagent.client.LogCollectManager.GetUserType() (see here -> https://samebug.io/crashes/1121921 ) And in our case, it was triggered by CWA...

@FriederikeHanssen , there is a very little chance for the moment to work around this. Unfortunately, I don't have any Huawei device, so I can give just some general hints: Are you able to find anything like this somewhere in your phone's settings: "AktivitĂ€tsprotokolle" or "Daten zur Benutzererfahrung" or "Datenerhebung durch Huawei" or "Huawei erlauben, Daten zu technischen Details und Interaktionen zu senden" or "Daten zur QualitĂ€t, Leistung und GerĂ€tefehlersuche an Huawei senden" ? It might be somewhere in your phone's settings, for example "Über mein Telefon" or "Datenschutz und Sicherheit" or any other Huawei-specific setting or menu.

I guess, when you started your phone for the very first time, you were asked to opt-in (or to opt-out) that Huawei is allowed to collect data to 'enhance the experience with your phone'. If you find it, could you try to opt-out and see, if it helps?

There is only a good chance, that it might mitigate that crash, when the whole service of collecting data (com.huawei.lcagent.client.LogCollectManager) is stopped. If the service is running anyway (which would then be bad behavior, in my opinion), and the opt-out just prevents sending the data to Huawei, then it will change nothing here.

Steps for trying to mitigate our crash here:

Any feedback how you succeeded is highly welcome! Good luck!

EDIT: I forgot, that re-starting your phone might be necessary -> see above

FriederikeHanssen commented 4 years ago

Thank you for the quick feedback!

The only thing close to any of the mentioned Huawei data collection option I found is: Einstellungen > Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services

which I turned off and restarted the phone. This didn't solve anything

Deleting the cache & storage did solve it. However, it looks like all the contacts from the last 14 days are gone now. I only see contacts with a time stamp from a few minutes ago. Additionally, it now says 'Unbekanntes Risiko' even though I have been using the app since it came out.

Additionally, this may or may not be related (and I completely forgot about it till now), the app re-setup itself without me doing anything a few days ago.

Either way, my immediate issue is solved. But it would be a shame if all the contacts are really lost for good now. Can you confirm whether deleting the cache & storage does this?

vaubaehn commented 4 years ago

@FriederikeHanssen

The only thing close to any of the mentioned Huawei data collection option I found is: Einstellungen > Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services

I think, you exactly spotted it! Great!

which I turned off and restarted the phone. This didn't solve anything

I should have mentioned in my comment before, to take the steps in exactly that order... My working assumption: actually a chain reaction shows up here. It looks like, from time to time, the Huawei Mobile Services might be triggered by CWA (without any active interaction) and crash. Unfortunately, in that moment, CWA will be closed. I assume, in that moment the encrypted database of CWA still to be open and not being closed properly, which then becomes corrupted. Upon next start, the database cannot be read anymore (because corrupted), and the error 9002: file is not a database appears. I suppose, subsequent crashes later may still be related to the corrupt database. So - by turning off Huawei Mobile Services (HMS), you may be able to prevent the first crash, what may prevent all subsequent crashes. Because your database was already corrupted, just turning off HMS doesn't change anything for CWA on the next run. Deleting data and cache also deleted the corrupted database, which is then newly initialized during the onboarding (another 'first' run) of CWA.

Deleting the cache & storage did solve it. However, it looks like all the contacts from the last 14 days are gone now. I only see contacts with a time stamp from a few minutes ago. Additionally, it now says 'Unbekanntes Risiko' even though I have been using the app since it came out.

Where exactly do you see the contacts? Inside the app? Or via Android > settings > apps > google > Covid-19-Benachrichtigungen?

Additionally, this may or may not be related (and I completely forgot about it till now), the app re-setup itself without me doing anything a few days ago.

Could you try to explain, what it means, 'the app re-setup' by itself?

Either way, my immediate issue is solved. But it would be a shame if all the contacts are really lost for good now. Can you confirm whether deleting the cache & storage does this?

Yes indeed, it would be a shame. Until now, I think, it was common sense here in the user community, that deleting data and cache of CWA doesn't harm the collected contacts, because they are stored in different places of the device (please correct me anyone, if I'm wrong). Only uninstalling all (or the only) official contact tracing apps (like CWA) should trigger the collected contacts to be erased from the device, I am now a little bit uncertain, if there might have been a change in the behaviour, introduced by the new version of the Exposure Notification Framework 1.6, that also deleteing data/cache of the contact tracing app triggers the ENF to reset all data? For the moment, I can't give a certain answer here, but if you describe, where you found the contacts with the timestamp, we'd have some more certanity...

FriederikeHanssen commented 4 years ago

With re-setup I mean that the app behaved exactly the way it did when I first installed it. Similar to today actually. So asking me whether I want to turn on Risikoermittlung and so on. I guess, if the collected contacts have not been deleted it is not an issue. I found the contact list inside Settings > Google > Covid-19-Benachrichtigungen > ÜberprĂŒfen auf mögliche Kontakte.

vaubaehn commented 4 years ago

With re-setup I mean that the app behaved exactly the way it did when I first installed it. Similar to today actually. So asking me whether I want to turn on Risikoermittlung and so on.

I understand. So, what you then saw some days ago, might indeed be a reset of CWA's data, because they might have become corrupted by a crash before. (The fallback routine seems to be in cwa-app-android/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/AppDatabase.kt) Additionally, there seems to be a flaw, that prevents CWA from accessing the database again. But it is obviously already in the focus of SAP -> #1037.

I guess, if the collected contacts have not been deleted it is not an issue. I found the contact list inside Settings > Google > Covid-19-Benachrichtigungen > ÜberprĂŒfen auf mögliche Kontakte.

If you found the contact list there, and it was empty, except the freshly fetched data for the last 14 days all with the same time stamp, then it's indeed a big concern, as it indicates, that the Exposure Summary might have been erased by the ENF. For me this is a new behaviour (or I must have missed something). This could (but not must) indicate, that the collected contacts (RPIs) also might have been erased. In any case, that should be clarified... Does anyone want to address this in a question in this repo?

But in the end, there are just few options at the moment, to make CWA work again after a corrupted database:

vaubaehn commented 4 years ago

Hi @FriederikeHanssen and everyone, as a follow-up on https://github.com/corona-warn-app/cwa-app-android/issues/1053#issuecomment-678381760 , @thomasaugsten is now on the question about deletion of collected contacts, here -> https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678692188

vaubaehn commented 4 years ago

Hi @FriederikeHanssen , could you provide an update on how things were going for you in the last 10 days? Did any crash on app start ocuur again? (Other issues like API 39508 or no automatic background update don't count here in this context ;) ) Thanks in advance for your feedback!

FriederikeHanssen commented 4 years ago

Hi @vaubaehn ! Everything works fine and as expected now 🎉 . No crashes, no API errors either 😄

vaubaehn commented 4 years ago

Hi @vaubaehn ! Everything works fine and as expected now tada . No crashes, no API errors either smile

Hi @FriederikeHanssen , that's great! Thanks for your feedback! Please report back here, if any problem occurs again. Last question for now: How are your system settings, that allow CWA to run quite smoothly... as far as I read from you, you set up CWA as protected background app (system setting). Did you additionally activate "Prioritized Background Activity" from inside CWA's settings? Did you set up anything else or could you give other users with similar problems some recommendations?

Thank you very much for your support!

EDIT: Could you also maybe provide your EMUI version number?

FriederikeHanssen commented 4 years ago

Hi @vaubaehn!

EMUI version number: 4.0.3

Yes, when installing the app,

  1. I added it to the protected apps: Einstellungen > Einstellungen > Akkumanager > GeschĂŒtzte Apps

  2. Priorisierte HintergrundaktivitÀt is turned off. I actually was not aware of this feature until now.

  3. Other than that, I just followed your suggestions: Turned off: Einstellungen > Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services

  4. And then deleting the cache & storage did solve it. However, this seems to have caused a deletion of contacts. This step should not be necessary when newly installing the app though.

vaubaehn commented 4 years ago

Hi @FriederikeHanssen ,

thanks a lot for your well structured feedback! Personally, I find your information very useful. :+1:

@svengabr : do you think, the stakeholders might consider it to be useful to extend the FAQ, especially for HUAWEI devices according to information/device setup presented here (points 1 to 3 provided in the afore comment by @FriederikeHanssen ) for increased stability? I would volunteer to create a PR for the FAQ (like I did before here -> https://github.com/corona-warn-app/cwa-website/pull/308) , if it is welcomed. Details could be discussed in Slack before creating PR.

@FriederikeHanssen Just some additional points: As far as I currently know, there may be different root causes, which in the end of a chain may result in this app crash. Trying to set up the device, that CWA and its background tasks/transactions are not killed by any OS specific behaviour (battery optimisation, app usage analysis (HMS), ...), can at least mitigate the likelihood of an app crash. In this context you might want to consider to turn on "Priorisierte HintergrundaktivitÀt" additionally, but I can't tell, if it has a positive additional effect to decrease the probability of future crashes. Anyway, as far as I can interpret some of the code changes, it looks like CWA will be more robust in general in future versions. As for your point 4:

And then deleting the cache & storage did solve it. However, this seems to have caused a deletion of contacts. This step should not be necessary when newly installing the app though.

It's not quite clear yet, whether the collected contacts (RPIs of exposures) have actually been deleted, or 'only' the history of the past checks. Unfortunately, this subject has been stale for more than two weeks now, after @thomasaugsten suggested to clarify with Google. Maybe @svengabr can push that subject to the developers again, because if deleting CWA data proves to reliably bring back CWA to work, without deleting collected RPIs/own TEKs, then this method should be immediately made public to support a big crowd of users who frequently run into the problem of app crashes! @svengabr : short summary, to avoid misunderstandings: it's not about deleting CWA data from inside the app (settings > delete), but from OS level (Android > Settings > Apps > CWA > Storage > delete data/cache). We know that the Google documentation states, that only uninstalling CWA erases RPIs/TEKs, but it looks like there might have been a change to ENF in the latest versions, and/or the documentation is not correct. PS.: possible deletion of RPIs/TEKs might be related to the google API token, which is newly generated, after deletion of data and before CWA calls ProvideDiagnosisKeys.

Thanks again!

FriederikeHanssen commented 4 years ago

I have turned the "Priorisierte HintergrundaktivitÀt" now. Will report back, if it crashes or leads to unexpected behaviour. But even without it, it has been running stable for now.

Sure, happy to help 😃

svengabr commented 4 years ago

@vaubaehn regarding your pull request you can go ahead. @mtb77 will have a look at it afterward.

Regarding the second issue, I will bring that up to the development team to answer your question.

Thank you!

vaubaehn commented 4 years ago

@vaubaehn regarding your pull request you can go ahead. @mtb77 will have a look at it afterward.

Regarding the second issue, I will bring that up to the development team to answer your question.

Thank you!

Hi @svengabr and @mtb77 ,

Regarding the first issue (PR), thanks a lot for your consideration. I'll try to finish it within the next days. If you don't hear anything from me until Thurdsday night, feel free to ping me.

Regarding the second issue (deletion of CWA data), there was a reply by @thomasaugsten ( https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-688267231 ) , as soon as after my comment. Let's track that issue over there :)

Thanks again!

vaubaehn commented 4 years ago

Erste Hilfe: „App schließt sich sofort nach dem Öffnen“

Die nachfolgenden Informationen wurden dank der UnterstĂŒtzung vieler Nutzerinnen und Nutzer, sowie Entwickler aus verschiedenen BeitrĂ€gen im GitHub-Issue #642 zusammengestellt (z. B. https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-674783001 , https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-674797144 , https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678687066 , https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678692188 ). Allerdings kann ich keine GewĂ€hrleistung fĂŒr VollstĂ€ndigkeit und Richtigkeit geben. Anwendung auf eigene Gefahr.

Wenn die Corona-Warn-App durch einen Fehler im Betriebssystem oder durch aggressive Energiesparmaßnahmen des Telefons unerwartet beendet wird, kann es vorkommen, dass bei einem erneuten Start die Corona-Warn-App nicht mehr auf ihre verschlĂŒsselten Datenbanken zugreifen kann. In diesem Fall schließt sie sich sofort wieder. Die Corona-Warn-App kann wieder zum Laufen gebracht werden, indem die Daten und der Cache der App ĂŒber die Android-Einstellungen gelöscht werden.

Achtung: Wenn Sie die Daten der Corona-Warn-App löschen, gehen folgende Daten/Einstellungen verloren:

Zum Löschen der Daten der Corona-Warn-App gehen Sie wie folgt vor:

(die angegebenen Pfade zum Erreichen der jeweiligen Einstellungen können je nach Telefon und Android-Version leicht abweichen):

  1. Navigieren Sie auf Ihrem Telefon zu Einstellungen > Apps > Corona-Warn-App.
  2. Klicken Sie auf „Stoppen erzwingen“.
  3. WĂ€hlen Sie „Speicher“, und löschen Sie danach Cacheund Daten, indem Sie auf die jeweiligen Buttons klicken.
  4. Um sicherzustellen, dass die Corona-Warn-App beim nĂ€chsten Start fĂŒr die Risiko-Ermittlung die gesamten letzten 14 Tage berĂŒcksichtigt, können Sie zunĂ€chst das System-Datum Ihres Telefons zurĂŒckstellen https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-684953232 . Damit alle Codes fĂŒr die Risiko-Ermittlung vom Server heruntergeladen werden, reicht es, wenn Sie das Datum auf den gestrigen Tag einstellen https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-688466416 . Wenn Sie auch möchten, dass die Corona-Warn-App anzeigt, dass Ihre Risiko-Ermittlung in den letzten 14 Tagen dauerhaft aktiv war, können Sie das System-Datum auch 14 Tage zurĂŒckstellen https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-685037382 . Um das System-Datum zurĂŒckzustellen, navigieren Sie auf Ihrem Telefon zuEinstellungen > Datum und Uhrzeit. Um das Datum einzustellen, mĂŒssen Sie ggf. Zeit automatisch ermitteln deaktivieren.
  5. Öffnen Sie nun die Corona-Warn-App. Ihnen wird erneut die EinfĂŒhrung gezeigt (das Onboarding). FĂŒhren Sie das Onboarding bis zum Ende durch. Wenn Ihnen der Hauptbildschirm angezeigt wird, warten Sie, bis Ihnen irgendein Risiko-Status angezeigt wird, und schließen Sie die App wieder.
  6. Stellen Sie nun das System-Datum wieder auf den aktuellen Tag ein (Android-Einstellungen > Datum und Uhrzeit). Aktivieren Sie ggf. wieder die automatische Zeitermittlung.
  7. Öffnen Sie nun die Corona-Warn-App erneut. Ihnen sollte nun Ihr richtiger Risiko-Status („niedriges Risiko“ oder „erhöhtes Risiko“) angezeigt werden.

Achtung:

Um die ZuverlĂ€ssigkeit der Hintergrundaktualisierung zu optimieren, und unerwarteten AbstĂŒrzen der Corona-Warn-App beim Öffnen vorzubeugen, befolgen Sie bitte diese Anleitung in den FAQ -> hier .

Falls Sie ein Huawei oder Honor Smartphone besitzen, sollten Sie zusÀtzliche diese Punkte beachten -> hier

Falls Sie ein Smartphone eines anderen Herstellers besitzen, können Sie hier ĂŒberprĂŒfen, ob Sie noch zusĂ€tzliche Einstellungen zur Verbesserung der ZuverlĂ€ssigkeit vornehmen können: https://dontkillmyapp.com/ (englisch) oder https://slack.com/intl/de-de/help/articles/360001562747-Bekannte-Probleme-mit-Android%E2%80%91Benachrichtigungen

vaubaehn commented 4 years ago

ZusĂ€tzliche Einstellungen fĂŒr Ă€ltere Huawei- oder Honor-Smartphones

Es ist bekannt, dass Huawei-GerĂ€te ein besonders aggressives Verhalten zur Optimierung der Akkulaufzeit zeigen. So werden Hintergrundprozesse der Corona-Warn-App sehr schnell beendet, wenn die App nicht anhand besonderer Einstellungen von der Akku-Optimierung ausgenommen wird. Das ‚Killen‘ dieser Hintergrundprozesse kann dazu fĂŒhren, dass die Corona-Warn-App entweder die Hintergrundaktualisierung zur Risiko-Ermittlung nicht durchfĂŒhrt, oder im schlimmsten Fall die Datenbanken der App beschĂ€digt werden könnten. Es wird daher empfohlen, die ‚Priorisierte HintergrundaktivitĂ€t‘ zu aktivieren, wie in der FAQ angegeben.

FĂŒr Ă€ltere GerĂ€te mit EMUI 4 (z. B. Huawei P8 lite) sollte neben dieser allgemeinen Empfehlung noch eine zusĂ€tzliche Einstellung vorgenommen werden: Stellen Sie die Corona-Warn-App wie folgt als ‚GeschĂŒtzte App‘ ein:

Um die StabilitĂ€t der Corona-Warn-App zu erhöhen, ist noch eine weitere Einstellung möglich – das Entziehen der Erlaubnis auf den Zugriff der Nutzungsdaten fĂŒr die Huawei Mobile Services. Ob es tatsĂ€chlich etwas bringt, oder eher nicht, ist Gegenstand der Diskussion und noch nicht abschließend geklĂ€rt (https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678413047 https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678542265 https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678743289 ). Aber einen Versuch ist es vielleicht wert:

Um die StabilitĂ€t weiter zu verbessern, sollten Sie ĂŒberprĂŒfen, ob noch mindestens 2GB freier Speicher fĂŒr den internen Speicher zu VerfĂŒgung stehen. Ist nĂ€mlich der Speicher zu voll (weniger als 1 GB freier Speicher), wird das Telefon immer langsamer, wodurch timeout-Probleme auftreten können. Sie erhalten dann z. B. Meldungen wie „App XYZ reagiert nicht mehr“. Geben Sie in diesem Fall Speicher frei, z. B.:

System-Update

FĂŒr neuere Huawei / Honor Smartphones liegt möglicherweise ein System-Update vor, dass die Corona-Warn-App auf eine Huawei-interne White-List setzt, und vom besonders aggressiven Energiesparen ausschließt. ÜberprĂŒfen Sie hier, ob Sie vielleicht ein System-Update erhalten können. Link: https://www.huaweiblog.de/news/huawei-geraete-bekommen-877kb-grosses-systemparameter-update/

Ansonsten können Sie prĂŒfen, ob Sie fĂŒr Ihr Telefon noch weitere Einstellungen vornehmen können, z. B. hier https://dontkillmyapp.com/huawei (englisch), oder hier https://www.huaweiblog.de/news/benachrichtigungen-push-problem-loesung-anleitung/ .

vaubaehn commented 4 years ago

First Aid: Reactivate Corona-Warn-App when "App closes immediately after opening"

Thanks to the support of many users and developers, the following information was compiled from various contributions in GitHub issue #642 (e.g., https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-674783001 , https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-674797144 , https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678687066 , https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678692188 ). However, I cannot guarantee completeness and correctness. Use at your own risk.

If the Corona-Warn-App is unexpectedly terminated due to an error in the operating system or aggressive energy-saving measures taken by the phone, it may happen that the Corona-Warn-App can no longer access its encrypted databases when it is restarted. In this case, it closes again immediately. The Corona-Warn-App can be made to work again by deleting the data and the cache of the app via the Android settings.

Attention: If you delete the data of the Corona-Warn-App, the following data / settings will be lost:

To delete the data from the Corona-Warn-App, proceed as follows:

(the paths specified to reach the respective settings may differ slightly depending on the phone and Android version):

  1. On your phone, navigate to Settings > Apps > Corona-Warn-App.
  2. Click on “Force Stop”.
  3. Select “Storage” and then clear the cacheand databy clicking the respective buttons.
  4. In order to ensure that the Corona-Warn-App takes the entire last 14 days into account the next time it is started for the risk determination, you can first change the system date of your phone https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-684953232 . So that all codes for the risk determination are downloaded from the server, it is sufficient if you set the date to yesterday's date https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-688466416 . If you also want the Corona-Warn-App to display that your risk determination has been permanently active in the last 14 days, you can set the system date back 14 days https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-685037382 . To change the system date, go to Settings > Date and Time on your phone. To set the date, you may have to deactivate Set time automatically.
  5. Now open the Corona-Warn-App. You will be shown the introduction again (the onboarding). Follow the onboarding to the end. When you see the main screen, wait for any risk status to appear and then close the app.
  6. Now set the system date back to the current day (Android Settings > Date and Time). If necessary, activate the automatic time determination again.
  7. Now open the Corona-Warn-App again. You should now see your correct risk status (“low risk” or “increased risk”).

Attention:

To optimize the reliability of the background update and to prevent unexpected crashes of the Corona-Warn-App when opening, please follow these instructions in the FAQ -> here https://www.coronawarn.app/en/faq/#no_risk_update.

If you have a Huawei or Honor smartphone, you should also note these points -> here.

If you have a phone from another manufacturer, you can check here whether you can make additional settings to improve reliability: https://dontkillmyapp.com/ or https://slack.com/intl/en-de/help/articles/360001562747 (you may adjust output to your language on button of that page).

vaubaehn commented 4 years ago

Additional settings for older Huawei or Honor smartphones

It is a known fact that Huawei/Honor phones show a particularly aggressive behavior to optimize battery life. Background processes of the Corona-Warn-App are terminated very quickly if the app is not excluded from battery optimization based on special settings. The 'killing' of these background processes can mean that the Corona-Warn-App either does not carry out the background update for risk determination or, in the worst case, the app's databases could be damaged. It is therefore recommended to activate the 'Prioritized Background Activity' as stated in the FAQ https://www.coronawarn.app/de/faq/#no_risk_update.

For older devices with EMUI 4 (e.g. Huawei P8 lite), in addition to this general recommendation, an additional setting should be made: Set the Corona-Warn-App as 'Protected App' as follows:

In order to increase the stability of the Corona-Warn-App, another setting is possible - withdrawing the permission to access usage data for the Huawei Mobile Services. Whether it actually has a positive effect or not is the subject of discussion and has not yet been finally clarified (https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678413047 https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678542265 https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-678743289 ). But it might be worth a try:

To further improve stability, you should check whether at least 2GB of free space is still available for the internal memory. If the memory is too full (less than 1 GB free memory), the phone becomes slower and slower, which can lead to timeout problems. You will then receive messages like "App XYZ is not responding". In this case, free up some memory, e.g.

System-Update

For newer Huawei / Honor smartphones there may be a system update that puts the Corona-Warn-App on a Huawei internal white list and excludes it from particularly aggressive energy saving. Check here to see if you might be able to get a system update. Link (German): https://www.huaweiblog.de/news/huawei-geraete-bekommen-877kb-grosses-systemparameter-update/

Additionally you can check whether you can make further settings for your phone, e.g. here https://dontkillmyapp.com/huawei, or here (German) https://www.huaweiblog.de/news/benachrichtigungen-push-problem-loesung-anleitung/.

vaubaehn commented 4 years ago

@mtb77 @svengabr @thomasaugsten If you find time, you'd like to check if above instructions are appropriate.

@mtb77 : Tomorrow I will send you a draft for changes to the FAQ. If they are in line with your needs, I will create a PR respectively. FAQ changes will be short and link to above comments. Enjoy your night!

svengabr commented 4 years ago

Thank you very much for the effort @vaubaehn! Your texts are looking very good to me.

I would like to discuss this as a topic in our daily meeting today so maybe a developer can have a look at it before publishing it to the FAQ website.

I will keep you updated.

vaubaehn commented 4 years ago

Hi @svengabr , thanks for your feedback. I also think, it's a good idea when dev department has a look on it.

I guess the GitHub rights management allows you to edit my comments at any time - so, please feel free to adjust anything according to your needs! At any time!

Edit: I incorporated small changes, mainly formatting, typos and small details.

vaubaehn commented 4 years ago

@mtb77 (and @svengabr ) : You've Got Mail

;)

ghost commented 3 years ago

Hello community,

this issue has been closed by mistake. I will reopen it.

Thanks, LMM

Corona-Warn-App Open Source Team

FriederikeHanssen commented 3 years ago

Hi!

Same thing happened again. Deleting cache&storage fixed it, but once again it looks like the IDs have been deleted.

Cheers,

sandoxy commented 3 years ago

My CWA P8 lite started to crash at startup, after I used it for more the 14 days. Now I did the following steps:

  1. I turned of the access for huawei to user data
  2. I turned of battery optimization fo CWA
  3. I turned on preor. background activity in CWA
  4. I forced CWA to stop
  5. I deleted cache and data of CWA
  6. I changed system date to 03.10.
  7. I started CWA again and followed the instructions
  8. I closed CWA
  9. I chanched system date back to today

CWA says: no risc status known, because CWA did not run 14 days

Google-Covid shows 14 checkups from today. The other checkups, wich where there before I deleted the CWA-data, are gone. And the checkup from today does not contain any keys - key-amount=0.

What did I do wrong?

svengabr commented 3 years ago

Could you please update to the latest version 1.5 and test if the update did fix the error?

sandoxy commented 3 years ago

Could you please update to the latest version 1.5 and test if the update did fix the error?

The app seemed to work after the reset of cache and data, before the update. But the contacts for the last 14 days are still lost (V1.5).

FriederikeHanssen commented 3 years ago

Updated it just now. now it hangs in the start screen (Logo on background) for about 10 seconds and then dies. Up until now it at least opened and I could navigate to the main window.

Update: I deleted storage & cache and it works again for now. But any previous contacts are gone. Will update you in the next days whether it is now running or failing again

sandoxy commented 3 years ago

My CWA P8 lite started to crash at startup, after I used it for more the 14 days. Now I did the following steps:

1. I turned of the access for huawei to user data

2. I turned of battery optimization fo CWA

3. I turned on preor. background activity in CWA

4. I forced CWA to stop

5. I deleted cache and data of CWA

6. I changed system date to 03.10.

7. I started CWA again and followed the instructions

8. I closed CWA

9. I chanched system date back to today

CWA says: no risc status known, because CWA did not run 14 days

Google-Covid shows 14 checkups from today. The other checkups, wich where there before I deleted the CWA-data, are gone. And the checkup from today does not contain any keys - key-amount=0.

What did I do wrong?

After update to 1.5. I did all the steps above againg and again all contacts are lost.

daimpi commented 3 years ago

@sandoxy @FriederikeHanssen

Your keys are not lost as long as you just deleted the CWA data and didn't un-/reinstall the app. They are still safely stored inside the Google Exposure Notification Framework (ENF).

That "days active" is zero again is just a display problem, but function wise nothing is lost. If you care about getting the full "14 days active" display immediately again just follow @vaubaehn's instructions here.

Some background: Afaiu the update to 1.5 should have caught errors such as yours, but there was a bug in the implementation (see also @vaubaehn's explanation here) which is why the error was not caught and you were not properly informed by the app.

vaubaehn commented 3 years ago

Hi @sandoxy ,

I'm a common user like you, but familiar with that issue, I will try to support you a little.

CWA says: no risc status known, because CWA did not run 14 days

Google-Covid shows 14 checkups from today. The other checkups, wich where there before I deleted the CWA-data, are gone. And the checkup from today does not contain any keys - key-amount=0.

What did I do wrong?

I'm not sure what went wrong here for you in particular - all steps you told us seem to be right, and for other users this procedure was succeeding.

... in the moment I'm writing here, above @daimpi already answered (and again: ... one thought :laughing: )

Could you please update to the latest version 1.5 and test if the update did fix the error?

The app seemed to work after the reset of cache and data, before the update. But the contacts for the last 14 days are still lost (V1.5).

like @daimpi wrote already, contacts should not be lost, only the entries in the log are gone.

After update to 1.5. I did all the steps above againg and again all contacts are lost.

like @daimpi wrote, contacts are retained, but due to a problem in a bug fix, CWA's data could not be reset automatically during the upgrade to 1.5.

vaubaehn commented 3 years ago

Hi @FriederikeHanssen , happy to find you here again (thanks for reporting!), but I'm sad about the circumstances :cry: . I'm trying to gather some information, to understand the underyling root cause better and to support developers in that way.

Updated it just now. now it hangs in the start screen (Logo on background) for about 10 seconds and then dies. Up until now it at least opened and I could navigate to the main window.

Update: I deleted storage & cache and it works again for now. But any previous contacts are gone. Will update you in the next days whether it is now running or failing again

Did I understand you right:

Did I understand everything correct? Having your feedback would be very helpful indeed.

And as @daimpi already wrote, only the history of checks should be cleared, but not the collected contacts. We had a verification for that in a different issue yesterday, that a risk encounter was showing up again after solely deleting storage, following the procedure above in this thread.

Thank you!

sandoxy commented 3 years ago

@sandoxy @FriederikeHanssen

Your keys are not lost as long as you just deleted the CWA data and didn't un-/reinstall the app. They are still safely stored inside the Google Exposure Notification Framework (ENF).

When I go to Settings-> Google->Covid-19. I see just two checkups, 08.10.(into that date I changed the settings while I resetted cache and data) and today. And in each checkup there ist just one entry, each with 0-key-count.

CWA shows, that it runs for 12 days.

I did not reinstall the app.

daimpi commented 3 years ago

@sandoxy could you provide us your device name, Android version and ENF version (ENF version can be found here).

sandoxy commented 3 years ago

@sandoxy could you provide us your device name, Android version and ENF version (ENF version can be found here).

Of cource: Huawei P8 lite Emui 4.0.3 Android 6.0 Version 17203704005

FriederikeHanssen commented 3 years ago

@vaubaehn ,

let's hope this helps fixing it then 😃 .

Let me know, if you need more info.

@daimpi Great to hear the contacts are not lost 👍 . I assumed they would be, because when I navigate to Google > Covid Benachrichtigungen it only shows a few (10ish or fewer) and only from the date of when I reseted storage &cache.

vaubaehn commented 3 years ago

Hi @FriederikeHanssen , thanks again for your support!

Please excuse my following pedantic questions... As we have 50 Shades of Crashes with CWA, I just want to be double sure, we're having only one source of crash here.

  • On Oct 4th app crashed -> I followed the above steps
  • Worked fine for a while, but eventually crashed again (can't tell you precisely when)
  • Repeated the above steps, just in case. Eventually, this also didn't help anymore.

Were all of these crashes of the same type? I'm asking, because you wrote in the third step, that clearing cache and data didn't help anymore, what would point to a different root cause. Did you see something like "9002: timed out while waiting for 60000 ms"? Or "cause 3: API(10).. no public key found"? Or have all crashes been like your first reported one: app immediately closing on start, without any error message?

  • Actually installed the Swiss covid app, it was written in some issue that this would preserve the contacts. Re-installed CWA, set it up as above, crashed as well

Same here: app closing or some different error message?

  • At some point then reported here again and was advised to update to 1.5.0, which I did. Then it got stuck in the start screen, clearing cache&storage ones again helped

That last one actually looks like the "old" app closes immediatly on start.

Thanks again...

svengabr commented 3 years ago

Hey everyone,

according to our developer's meeting, the issue is most likely related to https://github.com/corona-warn-app/cwa-app-android/issues/642 which should have been initially resolved for 1.5. Unfortunately, a small code fragment needed to be added which will be part in an upcoming hotfix release 1.5.1.

The related pull request is https://github.com/corona-warn-app/cwa-app-android/pull/1433

In the mean time you could try the workaround of @vaubaehn

Thank you very much for your understanding!

Best regards, SG

Corona-Warn-App Open Source Team

Neuwessi11 commented 3 years ago

Hi svengabr,

gibt es denn schon eine Vorstellung von dem ungefÀhren Termin, an dem das Hotfix kommt?

Neuwessi11 commented 3 years ago

Hi at all, my sister told me, that nothing has changed. Even after updating to 1.5.1 white screen with CWA-symbol, no chance of pressing any button, followed by a shutdown of the app. I maybe should mention that she did not try the workaround, because she hoped for the 1.5.1. But this unfortunatly did not work in her case.

Still Huawei P8 Lite Android 6.0

MikeMcC399 commented 3 years ago

@Neuwessi11

If your sister's app is still crashing then the options are:

  1. Workaround by deleting the app data, which means that the history of exposure checks is lost. We are told though that the actual keys are kept, even though you can't see them. (See https://github.com/corona-warn-app/cwa-app-android/issues/642#issuecomment-688267231). Experiments have shown that deleting the app data also causes the stored keys to be lost.
  2. Wait for version 1.6 which is expected to fix the issue in https://github.com/corona-warn-app/cwa-app-android/issues/642 which is another one of the hot topics.

I have no information about when 1.6 will be released, but I would expect it will be soon.

Edit: Version 1.6 was released on Nov 11, 2020. The current version is now 1.7.1 and the issue #642 has been closed as fixed.

Neuwessi11 commented 3 years ago

Thanks again!

My sister now tried the workaraound incl. changing of time settings, and today is already the 2. day CWA working!

So thanks to all who answer and answered here!

But one point of criticism is still left: I am a complete unsuspecting layman in app-building, but it is more than hard for me to understand why a workaround is necessary for not too less people just to make CWA working. Especially when this bug is known for months. Why has it during months not been possible to fix this bug? It is the Telekom and SAP writing the app, and as far as I know these are two very big players (recieving some money for that) and not only my cousin or brother-in-law scribbling around in their leisure time. Please do not misunderstand me: I don't want at all to revile all the people who write here in their leisure time to help those unsuspecting people like me, and I have the utmost respect to all these people, especially regarding that the workaround came from them and neither from Telekom nor SAP. Have a nice weekend!

heinezen commented 3 years ago

This was addressed in CWA 1.5 and 1.6. The issue should be fixed now. Please comment here if it is still re-occuring for you.


Corona-Warn-App Open Source Team