i want to set a background location tracker for that i use the location_background plugin and follow the steps in background location wiki but when i run build task i get this error :
/home/walid/Desktop/covid19/covid19/android/app/src/main/kotlin/com/example/covid19/Application.java:17: error: incompatible types: PluginRegistry cannot be converted to FlutterEngine GeneratedPluginRegistrant.registerWith(registry); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 52s
the Application.java code :
package com.example.app;
import com.lyokone.location.LocationPlugin;
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class Application extends FlutterApplication implements PluginRegistry.PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
LocationPlugin.setPluginRegistrant(this);
}
@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
}
android SDK 28 Flutter 1.12.13+hotfix.8