Register Capacitor 5+ plugin - examples for

I’ve been looking into code errors related to registering a plugin in a Capacitor 5+ environment.

From a popular plugin epicshaggy’s capacitor-native-biometric

But this example seems to be related to Capacitor < V5.

import com.epicshaggy.biometric.NativeBiometric;

public class MainActivity extends BridgeActivity {
  public void onCreate(Bundle savedInstanceState) {

    // Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Additional plugins you've installed go here
      // Ex: add(TotallyAwesomePlugin.class);

This code shows all sorts of errors, so I was wondering if there exists a strong example of how to do this?

Thanks for reading.

Capacitor 3 introduced automatic plugin registration, you don’t need the init method, plugins should be registered automatically.

But note that the plugin doesn’t support Capacitor 5 yet.

1 Like