Comments (10)
It looks like you have code that somehow modifies the BeaconParser array after the service is started, which does not look to me like it is possible with the latest code. Can you tell me the version of the library you are using?
from android-beacon-library.
Thank you for your attention. I'm using the "android-beacon-library-2.0.aar" version. I downloaded it from "http://altbeacon.github.io/android-beacon-library/download.html".
from android-beacon-library.
i have approximatively the same. And i use last 2.0 version (without any modification) :
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
at java.util.HashMap$KeyIterator.next(HashMap.java:833)
at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.org.altbeacon.beacon.distance.DistanceCalculator findCalculatorForModel(org.altbeacon.beacon.distance.AndroidModel)(Unknown Source)
at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.access$600(Unknown Source)
at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator$1.void onComplete(java.lang.String,java.lang.Exception,int)(Unknown Source)
at org.altbeacon.beacon.distance.ModelSpecificDistanceUpdater.java.lang.Void doInBackground(java.lang.Void[])(Unknown Source)
java.lang.Object doInBackground(java.lang.Object[])
at org.altbeacon.beacon.distance.ModelSpecificDistanceUpdater.java.lang.Void doInBackground(java.lang.Void[])(Unknown Source)
java.lang.Object doInBackground(java.lang.Object[])
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more
from android-beacon-library.
The core issue is that the library fails to block updates of the beaconParsers after the service has started. This needs to be fixed.
As a temporary workaround, make sure you make an calls to:
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout(...));
before the BeaconService is started. If using the RegionBootstrap
class, put this line before it is constructed. If calling beaconManager.bind(this)
, put this line before that call.
from android-beacon-library.
@mturki here is fix for it: #245
from android-beacon-library.
This crash has been reoccurring in 2.9.2, see the recently added comments on PR #245
from android-beacon-library.
I have run into this crash on 2.12.2. Here is the stack trace
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1441)
at java.util.HashMap$KeyIterator.next(HashMap.java:1465)
at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.findCalculatorForModel(ModelSpecificDistanceCalculator.java:123)
at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.findCalculatorForModelWithLock(ModelSpecificDistanceCalculator.java:105)
at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator$1.onComplete(ModelSpecificDistanceCalculator.java:251)
at org.altbeacon.beacon.distance.ModelSpecificDistanceUpdater.doInBackground(ModelSpecificDistanceUpdater.java:30)
at org.altbeacon.beacon.distance.ModelSpecificDistanceUpdater.doInBackground(ModelSpecificDistanceUpdater.java:16)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
from android-beacon-library.
@TonyTangAndroid, do you know the OS version on which you have seen this crash?
from android-beacon-library.
Android 8.0 Google Pixel.
Sorry that I was too quick to paste the stack trace and forgot to provide this critical information.
from android-beacon-library.
Fixed in #584
from android-beacon-library.
Related Issues (20)
- No beacons after locked screen HOT 21
- Cannot parse iBeacons HOT 3
- BeaconService.startForegroundIfConfigured HOT 12
- TargetSdk 34 (android 14) Beacon foreground service no longer working due to new Google restriction HOT 1
- Do we have sample app to implement the library including the operation running in Background HOT 4
- Only a maximum of 2 beacons can be received at a time HOT 1
- java.io.FileNotFoundException android-distance.json HOT 3
- android-distance.json database not found
- Crash when parsing _lengthy_ beacon data fields HOT 3
- Custom Distance calculator is being overwritten HOT 6
- Samsung devices not detecting beacons by intent after first screen off HOT 1
- Can we use this with tauri mobile? HOT 3
- Main thread can be blocked sometimes
- Android 14 didDetermineStateForRegion no beacon is detected or scanned HOT 2
- https://s3.amazonaws.com/android-beacon-library/android-distance.json,This network requests security questions.
- ScanJob restarts scanning every time on navigation HOT 2
- Beacon Not Detected by AltBeacon Library
- altbeacon does not detect beacon devices on Android 12 and later HOT 10
- altbeacon enforces 15 min backgroundBetweenScanPeriod on android 8+
- when the user puts the app to background and then foreground more than 5 times within 30 seconds, app gets "scanning too frequently error" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-beacon-library.