Ionic admob plugin error


#1
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build android (exit code 1):

        (truncated) ... un/cordova/admob/AdMobPlugin.java:112: error: cannot find symbol
        adSize = new AdSize(adWidth, adHeight);
        ^
        symbol:   variable adHeight
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:146:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:154:
        error: cannot find symbol
        PublisherAdView ad = new PublisherAdView(getActivity());
        ^
        symbol:   method getActivity()
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:160:
        error: cannot find symbol
        AdView ad = new AdView(getActivity());
        ^
        symbol:   method getActivity()
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:168:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:189:
  error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:192:
        error: cannot find symbol
        return sz.getWidthInPixels(getActivity());
        ^
        symbol:   method getActivity()
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:195:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:198:
        error: cannot find symbol
        return sz.getHeightInPixels(getActivity());
        ^
        symbol:   method getActivity()
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:201:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:214:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:227:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:242:
  symbol:   method getActivity()
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:261:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:274:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:293:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:303:
        error: method does not override or implement a method from a supertype
        @Override
        ^
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:308:
        error: cannot find symbol
        RewardedVideoAd ad = MobileAds.getRewardedVideoAdInstance(getActivity());
        ^
        symbol:   method getActivity()
        location: class AdMobPlugin
        /Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:326:
        error: method does not override or implement

symbol: method getActivity()
location: class AdMobPlugin
/Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:261:
error: method does not override or implement a method from a supertype
@Override
^
/Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:274:
error: method does not override or implement a method from a supertype
@Override
^
/Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:293:
error: method does not override or implement a method from a supertype
@Override
^
/Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:303:
error: method does not override or implement a method from a supertype
@Override
^
/Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:308:
error: cannot find symbol
RewardedVideoAd ad = MobileAds.getRewardedVideoAdInstance(getActivity());
^
symbol: method getActivity()
location: class AdMobPlugin
/Users/mertbuldur/Desktop/ionic/app1/platforms/android/src/com/rjfun/cordova/admob/AdM
obPlugin.java:326:
error: method does not override or implement Ionic cordova build is like this.


#3

Were you able to solve this? I also need a solution. I encountered the supertype @Override error when I added the admob free plugin by ratson.


#4

hello,
ionic and admob… what a mess. This is one of the reason why I think twice, if I use ionic again for whatever and mostly …

But this will not help you.

Maybe https://enhance.co/ is something you can use. It is for me a complete black box, so I do not know if this way has any negative and unwanted effects.

Best regards, anna-liebt


#5

@anna_liebt This thread is for the answer to the “ionic and admob” error and not for marketing whatsoever. The question is clear for “ionic and admob”.