SwissCovid / swisscovid-app-android

SwissCovid is the official contact tracing app of Switzerland.
Mozilla Public License 2.0
222 stars 57 forks source link

Cryptic Error Message when Exposure Notification API is not available #51

Closed alexandredeleze closed 4 years ago

alexandredeleze commented 4 years ago

I tried the commit 3dd348c025f82434fc6183be7c2262516d5f7d0e and because by Honor 8X didn't receive the update from Google, I don't have the exposure notification api. When I try to activate the tracing an alert pop up with I think the original error message "17: API: Nearby.Exposure_NOTIFICATION_API is not available on this device. Connection failed with: ...". Maybe it can be good to modify this error message for the user.

zukunft commented 4 years ago

I have the same with a OnePlus 5T and LineageOS. Would be nice if there would be also a "non GAEN" Version.

micahwilhelm commented 4 years ago

I get the same error on my Moto X 2nd Gen running LineageOS 16.0 (based on Android 9) when trying to activate tracing:

17: API: Nearby.EXPOSURE_NOTIFICATION_API is not available on this device. Connection failed with: ConnectionResult{statusCode=UNKNOWN_ERROR_CODE(39501), resolution=null, message=null}"

senic35 commented 4 years ago

Same error on my OnePlus 7Pro with OxygenOS 10.0.0.5

michalogit commented 4 years ago

Same error, huawei p20 lite, android 9

Screenshot_20200526_205217_ch admin bag dp3t

Continuum-Q commented 4 years ago

Same issue on Google Pixel 4XL on May 5th security update. Screenshot_20200527-094438

Laraakaa commented 4 years ago

Seems to be linked when the app is not signed with the official certificate (e.g. when you build it from source and install it on your own device). After downloading the correct signed version from the Play Store, the error message disappeared (only for that version of the app).

Would be cool if we could also build it ourselves to debug, test and analyze it fully, instead of relying on the Play Store build.

kplanz commented 4 years ago

The same is true for the calibration app (in the SDK project) btw.

Logcat shows the following message:

ExposureNotification: Reject the api access due to the caller is not whitelisted

stefanriesen commented 4 years ago

Get the same message here in the follwoing environment

naspert commented 4 years ago

same here with Fairphone 2 Android 7.1 and app installed through Play Store

beckm-ethz commented 4 years ago

Also got the UNKNOWN_ERROR_CODE(39501) on:

Flash1232 commented 4 years ago

Got UNKNOWN_ERROR_CODE(39507) on:

LoremoCH commented 4 years ago

Same or similar problem on Fairphone 2

Most of the time it does not work right at the start. Sometimes the app briefly shows that it is working normally. But after a few minutes the following message appears.

Screenshot_20200601-150437

Screenshot_20200601-151051

Screenshot_20200601-105657

simonpra commented 4 years ago

Got the same yesterday on my Honor 10. With last Google Play Service 20.18.something. Updated with Google Play Service 20.21.15 (bêta), at first same error, but today everything's working ;-)

Try updating the Google Play Service to the bêta version (must be registered for bêta preview).

simonroesch commented 4 years ago

There were several issues here:

ApiException 17 with statusCode=39501 was an error in the ExposureNotification framework of Google that happened on devices not supporting [bluetooth multiple advertisement](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#isMultipleAdvertisementSupported()). This issue has been fixed now by Google and should no longer happen. If it still does happen. on your device, please open a new issue and include the app version, the Google Play Services version as well as the output of adb shell dumpsys activity provider com.google.android.gms.chimera.container.GmsModuleProvider | grep 'nearby_en'

ApiException 17 with statusCode=39507 is due to Google checking the app signature when using the ExposureNotification framework. Only our production signature (used for PlayStore builds only) is whitelisted, therefore it is currently not possible to use the ExposureNotification framework when the app is not downloaded from the PlayStore but build individually. We are hoping for a solution from Google to enable developers to use the framework also with non-whitelisted apps (signatures). We are also working on reproducible builds that will allow to verify that the APK from the PlayStore is built from the source code provided here.

For phones without Google Play Services we do not yet have a solution, the app currently uses the Google ExposureNotification framework distributed as part of the Google Play Services.