mjaakko / NeoStumbler

New stumbler application for contributing data to Mozilla Location Services
MIT License
102 stars 8 forks source link

FileNotFound amazonaws #78

Closed Jose92 closed 3 months ago

Jose92 commented 3 months ago

Hello, when launching the application, on an Android 15 phone, with google services, using the Fdroid flavor, we can see in the logs the following error:

2024-05-19 14:38:57.472 27861-27950 DistanceConfigFetcher   xyz.malkki.neostumbler.fdroid.dev    W  error reading beacon data
      java.io.FileNotFoundException: https://s3.amazonaws.com/android-beacon-library/android-distance.json
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255)
    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:211)
    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:30)
    at org.altbeacon.beacon.distance.DistanceConfigFetcher.request(DistanceConfigFetcher.java:94)
    at org.altbeacon.beacon.distance.ModelSpecificDistanceUpdater.doInBackground(ModelSpecificDistanceUpdater.java:28)
    at org.altbeacon.beacon.distance.ModelSpecificDistanceUpdater.doInBackground(ModelSpecificDistanceUpdater.java:16)
    at android.os.AsyncTask$3.call(AsyncTask.java:394)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
2024-05-19 14:38:57.472 27861-27950 ModelSpeci...Calculator xyz.malkki.neostumbler.fdroid.dev    
W  Cannot updated distance models from online database at java.io.FileNotFoundException: https://s3.amazonaws.com/android-beacon-library/android-distance.json

It doesn't seem to affect the rest of the behavior

mjaakko commented 3 months ago

Thanks for the report. I think this could be fixed by providing a stub implementation of the distance calculator to the beacon library (https://altbeacon.github.io/android-beacon-library/javadoc/org/altbeacon/beacon/Beacon.html#setDistanceCalculator(DistanceCalculator)). The estimated distance is not used in any way