admob-plus icon indicating copy to clipboard operation
admob-plus copied to clipboard

Error loading AdMobPlusPlugin

Open ingojoseph opened this issue 1 year ago • 8 comments

Describe the bug After installing Admob Plus Capacitor plugin with npm install @admob-plus/capacitor, and running ionic cap sync android, I get the following error when starting my Android app:

Error loading plugins.
  com.getcapacitor.PluginLoadException: Could not find class by class path: admob.plus.capacitor.AdMobPlusPlugin
  at com.getcapacitor.PluginManager.loadPluginClasses(PluginManager.java:35)
  at com.getcapacitor.BridgeActivity.onCreate(BridgeActivity.java:32)

Has anyone else got the same issue and was able to fix it?

Environment

  AdMob Plus Environment Info:
    System:
      OS: macOS Monterey 12.5
      CPU: (8) arm64 Apple M2
      Memory: 185.91 MB / 16.00 GB
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 19.6.1 - /opt/homebrew/bin/node
      Yarn: 1.22.19 - /opt/homebrew/bin/yarn
      npm: 9.4.0 - /opt/homebrew/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    Utilities:
      Clang: 14.0.0 - /usr/bin/clang
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
      Android SDK:
        API Levels: 32, 33
        Build Tools: 30.0.3, 33.0.1
        System Images: android-33 | Google APIs ARM 64 v8a
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9123335
      Xcode: 14.1/14B47b - /usr/bin/xcodebuild
    npmPackages:
      typescript: ^4.1.3 => 4.9.5 
    Cordova:
      Version: 
You have been opted out of telemetry. To change this, run: cordova telemetry on.
12.0.0 ([email protected])
    Ionic:
      Version: 6.20.4
    AndroidManifest.xml:
      Version: -

ingojoseph avatar Jul 06 '23 12:07 ingojoseph

@ingojoseph I am not sure what cause the error. Do you see admob-plus-capacitor in android/capacitor.settings.gradle? Or setup a test repo for me to check.

ratson avatar Jul 09 '23 08:07 ratson

Im getting the same issue. Building to a Samsung Tab A, Android 11

android/capacitor.settings.gradle

include ':admob-plus-capacitor'
project(':admob-plus-capacitor').projectDir = new File('../node_modules/@admob-plus/capacitor/android')

The error Im getting in android studio:

Error loading plugins.
com.getcapacitor.PluginLoadException: Could not find class by class path: admob.plus.capacitor.AdMobPlusPlugin
	at com.getcapacitor.PluginManager.loadPluginClasses(PluginManager.java:35)
	at com.getcapacitor.BridgeActivity.onCreate(BridgeActivity.java:31)
	at android.app.Activity.performCreate(Activity.java:8207)
	at android.app.Activity.performCreate(Activity.java:8191)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3819)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4022)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2336)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:246)
	at android.app.ActivityThread.main(ActivityThread.java:8653)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

pieshop avatar Aug 04 '23 22:08 pieshop

A follow up - when I install this all other capacitor plugins are also no longer available (Device, FileSystem, Network etc). Uninstall and the plugins are available again.

pieshop avatar Aug 07 '23 23:08 pieshop

I have also a problem with the capacitor plugin.

I get this error message:

File: https://localhost/main.da3c3b98d4af59fb.js - Line 1 - Msg: ERROR Error: Uncaught (in promise): Error: "AdMobPlus" plugin is not implemented on android
Error: "AdMobPlus" plugin is not implemented on android

When the AdMobPlus plugin is installed all the other capacitor plugins are not working anymore. Without the plugin everything is fine.

Here is a small basic example: https://github.com/kisimediaDE/IonicTest It has just the basic template for "Ionic - Tab" and then outputs the info of the App plugin in the explore-container and should show a banner (app.component.ts)

Without AdMobPlus the App plugin is working as expected. With this plugin is not working anymore.

kisimediaDE avatar Aug 24 '23 15:08 kisimediaDE

I can also confirm this issue. It started happening after the update from Capacitor 3 to Capacitor 4.

Does anyone have any alternative plugins that they would recommend while this gets sorted out?

Lpn01 avatar Sep 01 '23 13:09 Lpn01

@Lpn01 @kisimediaDE you can use my forked plugin "community-admob-plus-cordova" https://github.com/EYALIN/community-admob-plus/tree/master/packages/cordova

people here approved it is worked with Capacitor as well

EYALIN avatar Sep 03 '23 07:09 EYALIN

@EYALIN Thanks for the suggestion. I already switched to @capacitor-community/admob and I'm still testing it to see if I'm happy with the way it works. I'm considering your plugin as well.

Lpn01 avatar Sep 03 '23 10:09 Lpn01

How to fix: Go back to using admob plus version 1.24.0.

StrongTS avatar Oct 05 '23 03:10 StrongTS