Open majmalmdt opened 2 months ago
Same here!
@vanlooverenkoen @DimmyMaenhout @NicolaVerbeeck @jorre127 @ikbendewilliam @virtualmarc @ashwin-dailype @resfandiari
@jeroentrappers @JasperVercammen
Any of you guys knows how to fix it?
@majmalmdt I made a possible solution on my fork. I'm doing tests right now and after that I'll do a PR.
Feel free to look the code's modifications and try it if you want. The example project is not running. There is an issue related with the flutter_local_notifications
plugin I ignored. However, is possible to try it on others projects changing the plugin's import on pubspec.yaml
file this way:
background_location_tracker:
your/path/to/the/flutter-background-location-tracker
My fork can be accessed here
Thanks @Jeferson505, your fork works perfectly fine for me. If it is okay with you letting others mention your fork directly in their project, then they could use this in their pubspec
dependencies:
background_location_tracker:
git:
url: https://github.com/jeferson505/flutter-background-location-tracker.git
I encountered multiple errors while trying to build my Flutter project using the background_location_tracker plugin. The errors are related to accessing and overriding the lifecycle property and method within the plugin's Kotlin code.
Steps to Reproduce:
Add the background_location_tracker plugin to the pubspec.yaml file. Attempt to build the Flutter project. Observe the build errors related to the lifecycle property in the BackgroundLocationTrackerPlugin.kt file.
Error Messages:
Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Environment:
Flutter Version: [Your Flutter version] Dart Version: [Your Dart version] Plugin Version: background_location_tracker 1.4.3 Android SDK Version: [Your Android SDK version] Kotlin Version: [Your Kotlin version] Possible Causes and Suggestions:
Private Access to lifecycle:
The lifecycle property in ProxyLifecycleProvider is private, leading to access errors. Access Modifier Conflict:
The code is trying to change the access modifier of lifecycle from public, which is not allowed. Missing override Modifier:
The lifecycle property needs an override modifier when overriding a superclass member. getLifecycle Method:
The getLifecycle() method seems to be incorrectly marked as override without a matching method in the superclass. Suggested Fixes:
Verify the correct access level of the lifecycle property and ensure that the override keyword is used where necessary. Make sure the plugin is compatible with the current versions of Flutter, Dart, and AndroidX. Update the plugin if a newer version is available that addresses these issues. Consider refactoring the Kotlin code to properly handle the lifecycle property. Additional Context:
The errors started appearing after upgrading to the latest version of Flutter and AndroidX. If the plugin is outdated or incompatible with the new versions, a fix or update may be necessary.