Capacitor-community / firebase-analytics not working

I have followed the instructions here:

However in Android I am getting the following error in the

cannot find symbol class Analytics Plugin

It also says the import is unused.


import android.os.Bundle;

import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;

import java.util.ArrayList;

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);

I just deleted the android folder and recreated and it solved the issue.
Not an ideal solution but it was a new project.

Now I have the same issue with my next plugin.;

Any ideas on how to resolve this? I don’t fancy rebuilding my entire android project each time I add a plugin.

I did the following:

ionic build
npx cap sync android
npx cap open android
Build -> Clean Project
File -> Sync Project With Gradle Files