Comments (8)
@jessolo, you are correct about the code flaw above but also that it is not causing the stack trace you mention.
I wonder if there is something special about your setup that is causing it to not find that file. Are you using the aar file with Android Studio (if so what version?) or the tar.gz file imported as an Android Library Project in Eclipse?
from android-beacon-library.
I am using the whole project as a library project. Converted from gradle to ant. I am not using the tar or the aar file. I am having the file in the assets folder. So it does not read from assets. If it loads from web and stores into the data directory, it does not read from the path.
from android-beacon-library.
This sounds contradictory: "I am having the file in the assets folder. So it does not read from assets." can you please explain? The code is throwing an exception because it cannot find the built-in json file.
from android-beacon-library.
As per the loading flow
- It tries to load from File from the path /data/data.... It does not find it, so throws a Runtime exception -- App Crashes. Moving to assets was a workaround. But it will not work.I am now not having the file from assets. When RuntimeException is thrown beacon service does not startup.It does not try to load from web.
from android-beacon-library.
@jessolo, understand that by repackaging the library and making the model-distance-calculations.json
file not available on the classpath, you are using the library in a non-standard way. It is this repackaging that is causing the problem.
That said, I have made some changes on the following branch that may allow you to use the library in this non-standard manner. Please give it a try and let me know if it helps:
https://github.com/AltBeacon/android-beacon-library/tree/proceed-with-missing-distance-calculator
If this solves your problem, I will test in a standard configuration and then merge this onto master.
from android-beacon-library.
This seems to be working in my case. Looks good. The RuntimeException is the one which created the issue. Pls merge it to the master.
from android-beacon-library.
merged to master
from android-beacon-library.
@davidgyoung Can you repost the link to your proposed changes? That link doesn't work anymore.
from android-beacon-library.
Related Issues (20)
- NPE crash in latest version (2.20.1) in StartupBroadcastReceiver HOT 1
- Range beacons when app is terminating HOT 7
- Beacons ranging not working on android 13 HOT 1
- App stops scanning right after screen is locked and starts giving the results right after unlocked HOT 1
- Android beacon library - multiple regions monitoring - unable remove regions HOT 2
- startForeground Exception when app is not in foreground HOT 3
- StartupBroadcastReceiver throws NullPointerException HOT 2
- 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
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.