-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the flutter beacon library and fixed compatibility issues #144
Comments
Refer to this workaround for Flutter 3.24+ : flutter/flutter#153281 (comment) Also, do not upgrade to the latest Kotlin / AGP / Gradle. My last try that DIDN'T work was Kotlin 1.8.22 / Gradle 8.3 / AGP 8.1.0. Currently I'm using Kotlin 1.8.0 / Gradle 7.5 / AGP 7.4.2 which works fine for now even in release build. The developer seems to end the support for this library. |
@kjm0202 was the error you got when the app crashes something similar to what I'm experiencing? My app keeps crashing with a NullPointerException ever since updating to latest flutter and gradle implementation. I/BluetoothAdapter(10889): BluetoothAdapter() : com.groupofseven.g7trailapp
E/RangedBeacon(10889): Could not construct RssiFilterImplClass org.altbeacon.beacon.service.RunningAverageRssiFilter
E/AndroidRuntime(10889): FATAL EXCEPTION: pool-20-thread-3
E/AndroidRuntime(10889): Process: com.groupofseven.g7trailapp, PID: 10889
E/AndroidRuntime(10889): java.lang.NullPointerException: Attempt to invoke interface method 'void org.altbeacon.beacon.service.RssiFilter.addMeasurement(java.lang.Integer)' on a null object reference
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.RangedBeacon.addMeasurement(RangedBeacon.java:79)
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.RangedBeacon.updateBeacon(RangedBeacon.java:39)
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.RangedBeacon.<init>(RangedBeacon.java:29)
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.RangeState.addBeacon(RangeState.java:61)
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.ScanHelper.processBeaconFromScan(ScanHelper.java:372)
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.ScanHelper.access$200(ScanHelper.java:61)
E/AndroidRuntime(10889): at org.altbeacon.beacon.service.ScanHelper$ScanProcessorRunnable.run(ScanHelper.java:455)
E/AndroidRuntime(10889): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/AndroidRuntime(10889): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/AndroidRuntime(10889): at java.lang.Thread.run(Thread.java:1012)
I/Process (10889): Sending signal. PID: 10889 SIG: 9
Lost connection to device. |
I couldn't remember 100% of the log, but yeah, I'd also seen NullPointException error. |
Try the updated version of this library, now ported to Kotlin with support for Flutter 3.x, Gradle, and an improved example: |
Thanks for your hard work! Did you also fix the build problem related to androidSdk > 31 in Flutter 3.24+? I'm eager to migrate your plugin. |
Yes, it resolves the build problem in Flutter 3.23+ when compiling for Android SDK 34. The migration process is quite simple:
Everything else remains the same. Additionally, I added the following code to improve beacon persistence in the list: await flutterBeacon.setScanPeriod(1000);
await flutterBeacon.setBetweenScanPeriod(500);
await flutterBeacon.setUseTrackingCache(true);
await flutterBeacon.setMaxTrackingAge(10000);
await flutterBeacon.setBackgroundScanPeriod(1000);
await flutterBeacon.setBackgroundBetweenScanPeriod(500); This is the first version of the porting. If you encounter any issues, please report them. |
@dariocavada, fantastic Dario! We had some crashes in production. Let's see if with your fix they're solved. |
Hi!
If the flutter_beacon library version 0.5.1 is not working with SDK version 3.24.2, it might be due to compatibility issues or updates needed for the library to support the latest SDK
Thank you for the amazing library!
The text was updated successfully, but these errors were encountered: