background_locator
background_locator copied to clipboard
Use other plugins in callback not working after upgrading to 1.4.0+1
When building app, getting this error:
e: C:\Development\Projects\Flutter\Test\android\app\src\main\kotlin\oko\oko\Application.kt: (8, 37): Unresolved reference: LocatorService
Application.kt
package oko.oko
import io.flutter.app.FlutterApplication;
import io.flutter.view.FlutterMain;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.battery.BatteryPlugin;
import rekab.app.background_locator.LocatorService;
class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
LocatorService.setPluginRegistrant(this)
FlutterMain.startInitialization(this)
}
override fun registerWith(registry: PluginRegistry?) {
if (!registry!!.hasPlugin("io.flutter.plugins.battery")) {
BatteryPlugin.registerWith(registry!!.registrarFor("io.flutter.plugins.battery"))
}
}
}
And version 1.4.0 realy doen't contains LocatorServer.kt file, unlike version 1.3.2
HI @khalitovsv Thank you for opening a new issue.
LocatorService
is removed from the recent version. Please refer to the wiki for more info.
Can you update instruction https://github.com/rekab-app/background_locator/wiki/Use-other-plugins-in-callback?
Thank you for pointing out, It's been updated;
[suggestion] I think it would be a good idea to add the necessary imports to this instruction (people using VS Code may need to open Android Studio to figure out what imports are missing) : https://github.com/rekab-app/background_locator/wiki/Use-other-plugins-in-callback
Also, some classes are deprecated, maybe this will be a problem in the future: