I am on Ionic Capacitor 6.2.0 (via node_module) and when I build in Android Studio Ladybug (macOS) I am getting an error that the official plugins are not implementing the parent Plugin method correctly:
Class 'CapacitorHttp' must either be declared abstract or implement abstract method 'onDestroy()' in 'Plugin'
- CapacitorCookies
- CapacitorHttp
- WebView
public class CapacitorHttp extends Plugin {
...
}
public abstract class Plugin {
...
protected abstract void onDestroy();
}
Both classes come from the same 6.2.0 package:
{
"name": "@capacitor/android",
"version": "6.2.0",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
...
}
mypackage % java --version
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment Homebrew (build 17.0.13+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.13+0, mixed mode, sharing)
Why is this happening? I cannot implement this method myself as it comes from a 3rd party.
I am on Ionic Capacitor 6.2.0 (via node_module) and when I build in Android Studio Ladybug (macOS) I am getting an error that the official plugins are not implementing the parent Plugin method correctly:
Class 'CapacitorHttp' must either be declared abstract or implement abstract method 'onDestroy()' in 'Plugin'
- CapacitorCookies
- CapacitorHttp
- WebView
public class CapacitorHttp extends Plugin {
...
}
public abstract class Plugin {
...
protected abstract void onDestroy();
}
Both classes come from the same 6.2.0 package:
{
"name": "@capacitor/android",
"version": "6.2.0",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
...
}
mypackage % java --version
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment Homebrew (build 17.0.13+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.13+0, mixed mode, sharing)
Why is this happening? I cannot implement this method myself as it comes from a 3rd party.
Share Improve this question asked Feb 6 at 8:21 jared_hexagonjared_hexagon 1811 gold badge1 silver badge15 bronze badges1 Answer
Reset to default -1Its an abstract function. That means you have to define it when you extend the class. That can be a no-op implementation if that's all you need, but you need to define it. Why is it abstract? Because the base class can't possibly know what you need to do to properly shutdown.