Skip to content
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

Use other plugins in callback not working after upgrading to 1.4.0+1 #201

Open
khalitovsv opened this issue Feb 15, 2021 · 4 comments
Open

Comments

@khalitovsv
Copy link

khalitovsv commented Feb 15, 2021

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

@mehdok
Copy link
Collaborator

mehdok commented Feb 15, 2021

HI @khalitovsv
Thank you for opening a new issue.

LocatorService is removed from the recent version. Please refer to the wiki for more info.

@khalitovsv
Copy link
Author

@mehdok
Copy link
Collaborator

mehdok commented Feb 15, 2021

Thank you for pointing out, It's been updated;

@steinmetz
Copy link

[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:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants