corona-warn-app/cwa-app-android

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

Closed this issue ยท 53 comments

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.

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.

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).

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?

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.

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

Ole28 commented

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.

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.

@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.

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?

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

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.

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

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

Ole28 commented

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.

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

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.

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

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).

  • check in your Settings, if your Region and Language are set to German(y) before you install the App.
  • if you updated the Google Play Services after you changed you Region/Language, then repeat setting the Region/Language to German(y)
    I forgot to mention that if the App works after all of this, you can set your language back

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.

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

So how can I whitelist my signature?

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

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.

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.

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.

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)

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)

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.

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: google/exposure-notifications-android#8

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

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

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...

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

  • NFC an
  • Standorte an
  • Play Service Vers. 20.18.17 (Kamera, Speicher an)
  • Carrier Service on (Standort, Kamera an)
  • Restart ja

ScreenCrop-20200616-142247
ScreenCrop-20200616-142330

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!

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

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.

@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.

cb109 commented

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 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

@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.

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.

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 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)

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.

@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

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

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 :-)

@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 #499 - and have some useful topic name to differ those different kind of API-17-Problems?

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.

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

Limag commented

Thank you.
Same here: An unmodified HUAWEI P20 lite from Germany with GooglePlayServices installed from PlayStore updated to 20.18.17 told me NEARBY_Nearby.EXPOSURE_NOTIFICATION_API...
Clearing data helped: Einstellungen->Apps->Google Play Dienste->Speicher ->Speicherplatz verwalten->Alle Daten lรถschen.
After this, I had success at the third try. So, waiting some minutes could help.

Joining the beta program for Google Play Services seems to have finally done the trick.

After following the previous advice of clearing the local cache and -storage for Playstore and Play Services, the app put up a notification, claiming that the installed Play Services version needs to be updated (which has been up to date on the stable branch).

Thank you all for your input. While we cannot solve this issue directly, the team implemented a more descriptive error description in the latest app version that also links to the FAQ which contain more information than could possible fit into a single mobile screen.