rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 329 forks source link

Application.kt - Unresolved reference: LocatorService #190

Closed marcoheine closed 3 years ago

marcoheine commented 3 years ago

When I want to build my Android-App, I get the following error:

Application.kt: (10, 37): Unresolved reference: LocatorService Application.kt: (15, 9): Unresolved reference: LocatorService

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:compileDebugKotlin'. Compilation error. See log for more details

Here is my Application.kt:

package XX.XX.XX

import io.flutter.app.FlutterApplication import io.flutter.plugin.common.PluginRegistry import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin; import io.flutter.plugins.pathprovider.PathProviderPlugin import com.tekartik.sqflite.SqflitePlugin import io.flutter.view.FlutterMain 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.sharedpreferences")) {
        SharedPreferencesPlugin.registerWith(registry!!.registrarFor("io.flutter.plugins.sharedpreferences"))
    }
    if (!registry!!.hasPlugin("io.flutter.plugins.pathprovider")) {
        PathProviderPlugin.registerWith(registry!!.registrarFor("io.flutter.plugins.pathprovider"))
    }
    if (!registry!!.hasPlugin("com.tekartik.sqflite.SqflitePlugin")) {
        SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
    }
}

}

marcoheine commented 3 years ago

I have the solution:

OLD: import rekab.app.background_locator.LocatorService

NEW: import rekab.app.background_locator.IsolateHolderService