EddyVerbruggen / nativescript-admob

NativeScript plugin to earn some precious :moneybag::moneybag: with ads by Google AdMob
MIT License
69 stars 26 forks source link

Error: java.lang.NullPointerException: Context cannot be null #86

Open leon486 opened 4 years ago

leon486 commented 4 years ago

I'm getting this error when ever I attempt to preload an insterstitial on android. Works fine on IOS. I'm attempting to preload when the app is ready and also on a button tap.

     admob.preloadInterstitial({
          testing: true,
          iosInterstitialId: "ca-app-pub-7029876000000000/0000000000",
          androidInterstitialId: "ca-app-pub-7029876000000000/0000000000",
          keywords: ["courier"],
          onAdClosed: function () { console.log("-interstitial closed-") }
      }).then(
        function(){
          this.adLoaded = true;
          console.log("-interstitial preloaded - you can now call 'showInterstitial' whenever you're ready to do so-");
        },
        function(error){
          console.log("admob preloadInterstitial error: " + error);
        }
      )'

using nativescript 6.5.0

vallemar commented 3 years ago

I have the same error. Is this plugin dead? The repository seems to have no movement

trialz92 commented 3 years ago

admob createInterstitial error: Error: java.lang.NullPointerException: Context cannot be null is it solve?