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

Error when communicating with Google API(17): Nearby.EXPOSURE_NOTIFICATION_API is not available on this device #508

Closed schildbach closed 4 years ago

schildbach commented 4 years ago

Describe the bug

I get the following error after the first welcome screens:

Cause: 3
Something went wrong.
Error when communicating with Google API(17)

The exception trace has the message:

Nearby.EXPOSURE_NOTIFICATION_API is not available on this device

This is on a Pixel 2, all up to date. Bluetooth is enabled.

corneliusroemer commented 4 years ago

Very strange, this shouldn't happen in your case being all up to date with Google stock phone. Are you sure there's nothing out of the ordinary?

I had hoped they had fixed the crash at least by now. One could have hoped for a better diagnostic error description.

Timo1993 commented 4 years ago

Same error on Xiaomi devices (in a beta version of the app). Are you going to support Custom ROMs as MIUI and other OS? The current version does not show this error (although it should still be present).

corneliusroemer commented 4 years ago

Same error on Xiaomi devices (in a beta version of the app). Are you going to support Custom ROMs as MIUI and other OS? The current version does not show this error (although it should still be present).

@Timo1993, they won't care about beta versions. Have you tried the release version from the app store?

Timo1993 commented 4 years ago

There is no error. But I cannot believe that the API is available on Xiaomi devices. I guess that the message is suppressed. The hotline told me that it is not compatible. So there is no error, but it seems to be not compatible.

negin-z commented 4 years ago

Same error on Huawei p30 (EMUI 10.0.1, Android 10)

Ole28 commented 4 years ago

Same error on Xiaomi Redmi 5 plus. (MIUI Global 11.0.2, Android 8.1) Only when I compile it myself. Playstore version works just fine I guess.

schildbach commented 4 years ago

Very strange, this shouldn't happen in your case being all up to date with Google stock phone. Are you sure there's nothing out of the ordinary?

Not sure if that's relevant: I built and installed version 1.0.2 from source, signing with my debug key.

uschindler commented 4 years ago

@schildbach This error message happens also when at the time that app was started, the Google Play Services were not yet uptodate. See #513 for a possible issue.

In short: If you got the message to update Google Play Services after starting the app, then triggered the update and after installation switched back to CWA, the error 17 is coming. The stack trace on "details" shows old version of play services.

A restart of phone or the CWA app helps.

uschindler commented 4 years ago

Hi,

The exception trace has the message:

Nearby.EXPOSURE_NOTIFICATION_API is not available on this device

This is on a Pixel 2, all up to date. Bluetooth is enabled.

What play services version does the exception trace shows behind the @ sign?

Aerysch commented 4 years ago

image We deployed the app today company wide and got the message on multiple device models. Attached is on from a Moto G7 Power.

schildbach commented 4 years ago

What play services version does the exception trace shows behind the @ sign?

17.3.0. I don't think there was GPS update while trying the app. In any case, the error persists.

uschindler commented 4 years ago

That's obvious: 17.3.0 is old. at least 18.xxxx required.

Did you phone ask you for an update? I had an old one with 17.3, too (was switched off for 5 months). After start of app, the play services asked for an update, which I did. But the error was then coming back.

Issue is that app wasn't restarted after play services update. I would make sure that play services are up to date: https://play.google.com/store/apps/details?id=com.google.android.gms

Then for safety restart the phone (or at least kill the CoronaWarnApp and restart it).

I opened issue #513

ThomasKramps commented 4 years ago

Got the same error on a CAT S41. Updating GoogePlay-Services helped.

Ole28 commented 4 years ago

I have play services version "20.21.15" and it shows me the same "17.3.0" version in the error code. I don't know why it does this.

Junimondschein commented 4 years ago

Gleicher Fehler auf Huawei Mate 20x (EMUI 10.0.0.200 Android 10)

freemin7 commented 4 years ago

Hatte das gleiche Problem beim Blackberry KEYONE. Da endete der Android support ebenfalls mit Version 8.1. Nach etwas warten (hatte den Google Play Service erst frisch installiert) hat es dann geklappt.

Junimondschein commented 4 years ago

Vielen Dank für die freundliche Nachricht.... Bin gespannt wann es funktioniert...

freemin7 notifications@github.com schrieb am Di., 16. Juni 2020, 12:47:

Hatte das gleiche Problem beim Blackberry KEYONE. Da endete der Android support ebenfalls mit Version 8.1. Nach etwas warten (hatte den Google Play Service erst frisch installiert) hat es dann geklappt.

— 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/508#issuecomment-644687253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP7FVQIJ5BXCAIW5KA7NLWTRW5ET5ANCNFSM4N7NBBMQ .

BerndGitH commented 4 years ago

Same issue (after restart too) at Samsung Galaxy J5 Model SM-J510FN Android 7.1.1

KnownAsEnrico commented 4 years ago

https://youtu.be/_aYHUGoq_l8

Huawei P40 Pro, mit nach-installierten Google Play Diensten [Google Play Services Beta v20.18.17 (120400-311416286)]

Bzw, eine HMS(Huawei Mobile Services)-Version wäre gut

Edit:

Okay, I think I just found a fix (at least for me).

nilsalex commented 4 years ago

Not sure if that's relevant: I built and installed version 1.0.2 from source, signing with my debug key.

A self-signed version cannot have access to the API, as this requires whitelisting.

schildbach commented 4 years ago

A self-signed version cannot have access to the API, as this requires whitelisting.

So how can I whitelist my signature?

nilsalex commented 4 years ago

I'm afraid there's no way: https://github.com/corona-warn-app/cwa-documentation/issues/214

schildbach commented 4 years ago

I'm afraid there's no way: corona-warn-app/cwa-documentation#214

Then if I can't install from source, what's the source good for? Even a code review is worthless because I can't be sure what's in the binary unless I build it myself.

nilsalex commented 4 years ago

The intention is, of course, that only approved applications from health authorities can access the contact tracing data. I encountered this problem as well when I wanted to test earlier versions. But protecting the collected and emitted keys from other apps is crucial, isn't it?

There have been discussions about reproducible builds on github, if you like to have a look.

schildbach commented 4 years ago

The intention is, of course, that only approved applications from health authorities can access the contact tracing data. I encountered this problem as well when I wanted to test earlier versions. But protecting the collected and emitted keys from other apps is crucial, isn't it?

Well, usually access to sensitive data is guarded by a grantable/deniable permission.

In this case however, the separation into different processes (and thus an interface between the two) would not even be necessary. If this app would collect the data itself it could consume it itself. No interface to more apps necessary.

There have been discussions about reproducible builds on github, if you like to have a look.

I'll have a look.

jbauerrfid commented 4 years ago

I found this issue as well on a Google Pixel 3. Retested with the app installed from Android Studio to grab the stack trace. The output is here:

2020-06-16 15:06:30.761 13539-13539/de.rki.coronawarnapp W/System.err: com.google.android.gms.common.api.ApiException: 17: API: Nearby.EXPOSURE_NOTIFICATION_API is not available on this device. Connection failed with: ConnectionResult{statusCode=UNKNOWN_ERROR_CODE(39507), resolution=null, message=null}
2020-06-16 15:06:30.761 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@17.3.0:4)
2020-06-16 15:06:30.761 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.api.internal.ApiExceptionMapper.getException(com.google.android.gms:play-services-base@@17.3.0:2)
2020-06-16 15:06:30.761 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.api.internal.zah.zaa(com.google.android.gms:play-services-base@@17.3.0:18)
2020-06-16 15:06:30.761 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa(com.google.android.gms:play-services-base@@17.3.0:211)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa(com.google.android.gms:play-services-base@@17.3.0:217)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa(com.google.android.gms:play-services-base@@17.3.0:115)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnectionFailed(com.google.android.gms:play-services-base@@17.3.0:79)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.internal.zag.onConnectionFailed(com.google.android.gms:play-services-base@@17.3.0:2)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.internal.BaseGmsClient$zzf.zza(com.google.android.gms:play-services-basement@@17.3.0:6)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.internal.BaseGmsClient$zza.zza(com.google.android.gms:play-services-basement@@17.3.0:25)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.internal.BaseGmsClient$zzc.zzc(com.google.android.gms:play-services-basement@@17.3.0:11)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.common.internal.BaseGmsClient$zzb.handleMessage(com.google.android.gms:play-services-basement@@17.3.0:49)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:107)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at com.google.android.gms.internal.common.zzi.dispatchMessage(com.google.android.gms:play-services-basement@@17.3.0:8)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at android.os.Looper.loop(Looper.java:214)
2020-06-16 15:06:30.762 13539-13539/de.rki.coronawarnapp W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:67)
ChuangSheep commented 4 years ago

I have faced the same issue on Mi 9. My app was downloaded from Google app store so I am not so sure why it is not working

CAUSE: 3
Some thing went wrong
---
Cause:
k0.b.a.a.c.k.b:17:API:Nearby.EXPOSURE_NOTIFICATION_API is not avaliabe on this device.
Connection failed with: a{statusCode=UNKNOWN_ERROR_CODE(39501,resolution=null,message=null)} at ......
......
at .... (@@17.3.0:**)
at android.os.Looper.loop(Looper.java:201)
at android.osHandlerThread.run(HandlerThread.java:65)
mxmxchere commented 4 years ago

I have the same Issue as well. I have a Google Pixel 3XL with the latest Android.

My Play Services Version is 20.18.17. However the Stockversion of Play Services is 17.7.86. I dont have a logged in Googleaccount on this phone and the Playstore app is deactivated. I downloaded the current Google Play Services through the Aurora-Store.

jbauerrfid commented 4 years ago

I found a similar issue in the Git repo of Google's reference app. Perhaps this is a problem in the Google library play-services-nearby-18.0.2-eap.aar imported through the lib folder. See also: https://github.com/google/exposure-notifications-android/issues/8

tkowark commented 4 years ago

@schildbach , just to clarify: the original issue also occurred on a self-built version of the app, right?

MichaelBiermann commented 4 years ago

Same on Xiaomi Mi Mix, MIUI 11.0.2 (stable).

The Corona app has been downloaded from official Play Store, launched by clicking the button on https://www.corona-warn-app.de .

Google Play Service version is 20.21.15, last updated 2020/06/11 07:17:36. Initially Google Services had been side-loaded (APK). Device OS tells "No updates available". Android 8.0.0, Android Security patch level 2018-10-01.

The API error shall be caught and at least a similar message as "Google Play" (see below) shall be shown.

I cannot use Google Pay with my Xiaomi Mi Mix device. May be that's exactly the same missing auth. needed for the API?!?

When setting up Google Pay (for instance) my device also shows weird behaviour even if it is NOT rooted.

Google Pay on Xiaomi

jbauerrfid commented 4 years ago

Finally I figured out how to take screenshots: comment out lines 101..104 in CoronaWarnApplication.kt

these lines

            activity.window.setFlags(
                WindowManager.LayoutParams.FLAG_SECURE,
                WindowManager.LayoutParams.FLAG_SECURE
            )

Now here are the error messages: image

After click details: image

Update: more testing revealed that the app works when installed from Google Play, but it fails with the error above, when compiled from source (which is quite stupid for an open source project, if you cannot test your own build...) Next I will try to add APK signing keys and check if that would work...

heike-hh commented 4 years ago

same problem > moto G5s (Android 8.1.0) ebenso : "Fehler bei Zugriff auf Google Play-Dienste Please complete action required by Carrier Services"

ScreenCrop-20200616-142247 ScreenCrop-20200616-142330

Cactus-World commented 4 years ago

Same error here. And from my research it is due to the already mentioned issue with the API not allowing self-compiled versions to access it. Thus I agree that offering the source code to gain trust into the app makes no sense as it cannot be guaranteed that the official version is compiled from this source code. This should absolutely be changed!

corneliusroemer commented 4 years ago

Friendly note, you can't compile from source code and expect it to work. The Exposure API will not work and you will get exactly this error 3, Cause Google API 17.

It's very important to state whether you installed from Play Store, Sideloaded or Compiled from Source. That makes a huge difference in the importance of the bug.

The reproducible build question is still entirely valid but not directly related to this problem. So you may want to close this issue here as a duplicate of https://github.com/corona-warn-app/cwa-documentation/issues/257

ChuangSheep commented 4 years ago

Friendly note, you can't compile from source code and expect it to work. The Exposure API will not work and you will get exactly this error 3, Cause Google API 17.

It's very important to state whether you installed from Play Store, Sideloaded or Compiled from Source. That makes a huge difference in the importance of the bug.

The reproducible build question is still entirely valid but not directly related to this problem. So you may want to close this issue here as a duplicate of corona-warn-app/cwa-documentation#257

I have installed it from Google Play , and it does NOT work. Very strange.

corneliusroemer commented 4 years ago

@ChuangSheep Thanks for clarifying. Can you add as much info as possible:

Then we have some structured info on where there are issues.

Plus, if possible list the things you have tried and that have failed.

PS: I'm not associated with the project, not getting paid or anything. Maybe also try calling the technical support hotline. Not sure this helps bit give it a go.

cb109 commented 4 years ago

I am also having this problem (UNKNOWN_ERROR_CODE(39503)) on a Huawei P9 Lite, Android 7.0, after being prompted to upgrade the Google Play Services. I updated them to v20.18.17, the CWA still tells me I have 17.3.0 though. No reboot or reinstallation helping so far. CWA was installed from the Play Store. I am logged into my Google account, the phone is not rooted or changed otherwise.

piratenkatzerrr commented 4 years ago

I am also having this problem (UNKNOWN_ERROR_CODE(39503)) on a Huawei P9 Lite, Android 7.0, after being prompted to upgrade the Google Play Services. I updated them to v20.18.17, the CWA still tells me I have 17.3.0 though. No reboot or reinstallation helping so far. CWA was installed from the Play Store. I am logged into my Google account, the phone is not rooted or changed otherwise.

I had a similar problem regarding Google Play Services v20.18.17 and CWA being stuck on 17.3.0. Deleting GPServices data and updating to v20.21.17 solved this problem for me.

cb109 commented 4 years ago

@piratenkatzerrr Thanks! Clearing the cache/data was not enough for me for some reason, although the CWA would again prompt me to update the Google Play Services. I joined its beta program through the app store and that seems to have triggered an update a few minutes later. I can use the CWA now.

ichderfisch commented 4 years ago

Same issue here on an old phone of mine. CWA thinks I'm on GPServices 17.3

* OS version  
* Model  
* Play services version  
* is anything on your phone modified from original shipped state (eg rooted, different OS etc.)
* are you logged into a Google account?

Android 7.1.1
Sony Xperia Z3 Compact
GPServices 20.18.17
nothing modified
Logged in with my Google Account.

Tried deleting app, restarting phone several times, signing up for Play Services Beta. Nothing has helped yet.

As it's only my second phone it's not to important for me, but you might clearify the error message in an future update of the app, as it seems to be a more common problem.


Edit: GPServices in Beta (still version 20.18.17 maybe a newer build?), clearing cached data, waiting over night, reboot the phone, reinstalled the app. Now it works.

CSchmidtDD commented 4 years ago

I do have the same issue but I can add a very useful insight that affects not only me, but also another user with an equal setup.

Whenever using/installing the app as a NON-Android Administrator account (Second User on the phone, not Guest-Account!) the BLE-beacon will not activate and throw this error. When switching to the main account that has access to all the administrative features on the phone, it works abolutely fine.

System and updates all up-to-date.

Huawei P20 EML-L29 Android 9 Build 9.1.0.387 Logged in with google account on NON-ADMIN Account of the phone.

Also with Sony Xperia ZX1 Compact with NON-ADMIN Account -> Same error.

ChuangSheep commented 4 years ago

@ChuangSheep Thanks for clarifying. Can you add as much info as possible:

  • OS version
  • Model
  • Play services version
  • is anything on your phone modified from original shipped state (eg rooted, different OS etc.)
  • are you logged into a Google account?

Then we have some structured info on where there are issues.

Plus, if possible list the things you have tried and that have failed.

PS: I'm not associated with the project, not getting paid or anything. Maybe also try calling the technical support hotline. Not sure this helps bit give it a go.

As in my previous comment:

I have faced the same issue on Mi 9. My app was downloaded from Google app store so I am not so sure why it is not working

CAUSE: 3
Some thing went wrong
---
Cause:
k0.b.a.a.c.k.b:17:API:Nearby.EXPOSURE_NOTIFICATION_API is not avaliabe on this device.
Connection failed with: a{statusCode=UNKNOWN_ERROR_CODE(39501,resolution=null,message=null)} at ......
......
at .... (@@17.3.0:**)
at android.os.Looper.loop(Looper.java:201)
at android.osHandlerThread.run(HandlerThread.java:65)

More info: OS: Android 10 (MIUI 11.0.9 stable) Model: Mi 9 (Xiaomi)

I have updated the framework, service und play store manually but it does not work either. Play service version: 20.21.17 Play store version: 20.5.19-all [0] [PR] 316024227 Google Framework version: 10(29)

Additional Information: The phone is not rooted, neither changed OS. I have logged into my google account. I believe it is worth to mention that I have 2 accounts on this phone. I'm not sure if it is because of what @Chrakker has mentioned. However, switch to the other account does not fix my issue.

I do have the same issue but I can add a very useful insight that affects not only me, but also another user with an equal setup.

Whenever using/installing the app as a NON-Android Administrator account (Second User on the phone, not Guest-Account!) the BLE-beacon will not activate and throw this error. When switching to the main account that has access to all the administrative features on the phone, it works abolutely fine. [...] Also with Sony Xperia ZX1 Compact with NON-ADMIN Account -> Same error.

Tried: Reboot, clear data/cache, reinstall app, manually update the google suit (framework, service, store)

HassenHichri commented 4 years ago

I'm having the same issue with Pixel 2 with Android and Google Play Services up to date and I have 2 users defined. The app will work fine on the Admin user but will throw this error on the other user.

corneliusroemer commented 4 years ago

@HassenHichri @ChuangSheep @Chrakker I opened a new issue with a more precise title to separate out different root causes for the (17) error. https://github.com/corona-warn-app/cwa-app-android/issues/605

Batlh commented 4 years ago

Selbe Problem beim Samsung Galaxy Note 8 bekomme folgende Meldung:

URSACHE: 3 Etwas ist schief gelaufen. Fehler bei Kommunikation mit Google API(17)

Ursache: k0.b.a.a.c.k.b: 17: API: Nearby.EXPOSURE_NOTIFICATION_API is not available on this device. Connection failed with: a{statusCode=UNKNOWN_ERROR_CODE(39503), resolution=null, message=null} at k0.b.a.a.c.k.l.f0.b(com.google.android.gms:play-services-base@@17.3.0:4) at k0.b.a.a.c.k.l.e$a.e(com.google.android.gms:play-services-base@@17.3.0:8) at k0.b.a.a.c.k.l.e$a.d(com.google.android.gms:play-services-base@@17.3.0:50) at k0.b.a.a.c.k.l.e$a.j(com.google.android.gms:play-services-base@@17.3.0:1) at k0.b.a.a.c.l.b$k.c(com.google.android.gms:play-services-basement@@17.3.0:4) at k0.b.a.a.c.l.b$f.a(com.google.android.gms:play-services-basement@@17.3.0:7) at k0.b.a.a.c.l.b$g.handleMessage(com.google.android.gms:play-services-basement@@17.3.0:52) at android.os.Handler.dispatchMessage(Handler.java:106) at k0.b.a.a.e.b.d.dispatchMessage(com.google.android.gms:play-services-basement@@17.3.0:1) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:65)

Android 9 aktueller Android Patch vom Juni 2020

Ceremony64 commented 4 years ago

I have managed to get it working on my rooted Pocophone F1 (running custom Android 10 rom with NikGapps): I had the latest Google Play Services installed, yet ran into the "Nearby.EXPOSURE_NOTIFICATION_API is not available on this device." issue.

To fix it, I did the following:

  1. Uninstall Corona Warn App
  2. Stop "Google Play" and "Google Play Services" and clear data and cache for both
  3. Reboot
  4. Open Google Play and reinstall Corona Warn App

I hope this helps anyone else having the same issue :-)


Ich habe es auf meinen gerooteten Pocophone F1 (mit Android 10 custom rom und NikGapps) zum laufen gebracht: Hatte die neusten Google Play Services installiert, aber trotzdem den Fehler "Nearby.EXPOSURE_NOTIFICATION_API is not available on this device." erhalten.

Behoben habe ich es wie folgt:

  1. Corona Warn App deinstallieren
  2. "Google Play" und "Google Play Services" beenden und deren Daten und Cache leeren
  3. Neu hochfahren
  4. Über Google Play die Corona Warn App wieder installieren

Ich hoffe es hilft auch anderen :-)

traut21 commented 4 years ago

@HassenHichri @ChuangSheep @Chrakker I opened a new issue with a more precise title to separate out different root causes for the (17) error.

605

But shouldn't this merged with https://github.com/corona-warn-app/cwa-app-android/issues/499 - and have some useful topic name to differ those different kind of API-17-Problems?

uschindler commented 4 years ago

Cache löschen und Neu starten würde schon mehrfach erfolgreich benutzt. Daten löschen ist teilweise sinnvoll, aber wäre zu vermeiden, sonst muss man mehrfach 2FactorAuth wiederholen.

mxmxchere commented 4 years ago

It works now on my phone. I got the GPS version 20.21.17 from apkpure or so (i know really not the way you want to get your stuff). After that i had the german description "Benachrichtigungen zu möglichem Kontakt mit COVID-19-Infirzierte" and the red symbol on the left hand side of it. I was able to click on it an get the list of apps that use the exposure-API. I clicked on the open-button next to the entry "Corona-Warn". After that it worked.

I do not have a google-account on my phone. I installed Corona-Warn through aurora and Play Services through the apkpure APK.

I am unsure whether it was the waiting or opening the Corona-app through the Google-Menu. Anyway it works now, so it is possible to use the App without a Google Account, yeey