Ionic + capacitor-community-admob problem

I heve running example of community admob but after install it in my project I have problem. When I add:

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

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

It’s looks like there is some dependency issue

however admob is installed. In example there in AndroidStudio is a section capacitor-comunity-admob witch I don’t have in my project

screen from demo example of admob:

Bez nazwy

screen from my project

I just ugraded my pretty much everything to version corresponding to this from example so that is not a reason

So try this…

npx cap sync

This will make sure source files are copied over and managed correctly. If that doesn’t work, you might need to resync your project with the gradle files.

This can be done by going from File/Sync Project with Gradle Files from the menu bar.

Screen Shot 2021-01-07 at 10.19.29 AM

3 Likes