I'm trying to run the example here. It's flutter & I'm trying to run it on an Android emulator. I'm getting an error:
> Task :app:compileDebugKotlin FAILED
[ ] e: /Users/user/flutter-samples/packages/stream_chat_v1/android/app/src/main/kotlin/com/example/example/Application.kt: (10, 1): Class 'Application' is not
abstract and does not implement abstract member public abstract fun registerWith(p0: PluginRegistry): Unit defined in
io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
[ +1 ms] e: /Users/user/flutter-samples/packages/stream_chat_v1/android/app/src/main/kotlin/com/example/example/Application.kt: (15, 5): 'registerWith' overrides
nothing
[ +95 ms] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':app:compileDebugKotlin'.
[ ] > Compilation error. See log for more 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 1m 57s
This is the Application.kt file:
package com.example.example
import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin
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
class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
}
override fun registerWith(registry: PluginRegistry?) {
PathProviderPlugin.registerWith(registry?.registrarFor(
"io.flutter.plugins.pathprovider.PathProviderPlugin"))
SharedPreferencesPlugin.registerWith(registry?.registrarFor(
"io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin"))
FlutterLocalNotificationsPlugin.registerWith(registry?.registrarFor(
"com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin"))
}
}
I tried looking at other similar answers, but they were all very specific to the functions and codes that those authors were using. What do I do?