cordova-admob-pro icon indicating copy to clipboard operation
cordova-admob-pro copied to clipboard

since 5.10.2018 new version of google admobs require extra things in …

Open slaszu opened this issue 6 years ago • 18 comments

since 5.10.2018 new version of google admobs require extra things in AndroidManifest.xml, 16.0.0 is the last compatible version

slaszu avatar Oct 14 '18 19:10 slaszu

Wow , Thank you. You are life saver. This works for me too!

juthawong avatar Oct 15 '18 16:10 juthawong

Thanks to @slaszu for the advice. The plugin has been modified to resolve this issue as a temporary solution. Try updating the plugin to [email protected]

floatinghotpot avatar Oct 16 '18 15:10 floatinghotpot

I upgraded Admobpro to @2.32.6 but my app now fails to connect to the internet... I can fix that by adding permission back into androidmanifest but the plugin messed up other files somewhere else that I can't find. My app is no longer working on a number of levels and reverting back to the previous version of admob doesn't help.

brittonk avatar Oct 18 '18 17:10 brittonk

On phonegap build, building with this plugin enabled land to the following compilation error:

 What went wrong:
Execution failed for task ':app:transformDexWithDexForArmv7Release'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/internal/zza;

Removing the plugin compile correctly...

Ices-Eyes avatar Oct 20 '18 09:10 Ices-Eyes

Same problem as cepenking here. With Phonegap Build, I've got this error: Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "cordova-plugin-admobpro" via npm Installing "cordova-plugin-admobpro" at "2.35.3" for ios Fetching plugin "cordova-plugin-extension" via npm Installing "cordova-plugin-extension" at "1.5.4" for ios Fetching plugin "cordova-admobsdk@~7.35.0" via npm Error during untar for /Users/gimlet/.cordova/lib/npm_cache/cordova-admobsdk/7.35.0/package.tgz: Error: EACCES: permission denied, open '/Users/gimlet/.cordova/lib/npm_cache/cordova-admobsdk/7.35.0/package/GoogleMobileAds.framework/GoogleMobileAds' Failed to install 'cordova-plugin-admobpro': CordovaError: Failed to fetch plugin cordova-admobsdk@~7.35.0 via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL.

juxfr avatar Nov 05 '18 20:11 juxfr

Same problem as juxfr here - but only on ios build using phonegap build. The android build works fine. Interestingly I found the JumpRope pgb example project referenced in the WIKI and tried building that and it gives exactly the same error

kevin-finesse avatar Nov 06 '18 09:11 kevin-finesse

If I run the test ads isTesting: true everything works correctly but if I set it isTesting: false the ads are no longer displayed. someone to help me with this, I have not been able to solve it for 2 days.

mauricioLopezRamirez avatar Nov 20 '18 06:11 mauricioLopezRamirez

@mauricioLopezRamirez please double check your admob ad unit id, and make sure the ad unit is created for the right platform and right type.

floatinghotpot avatar Nov 21 '18 02:11 floatinghotpot

Hello. On ios banner works, but instead of interstitial ads go to googleads.g.doubleclick.net How can this be solved?

Winamp9 avatar Nov 24 '18 08:11 Winamp9

Same problem as juxfr & kevin-finesse

With Phonegap Build, I've got this error:

Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "[email protected]" via npm Installing "cordova-plugin-admobpro" at "2.35.4" for ios Fetching plugin "cordova-plugin-extension" via npm Installing "cordova-plugin-extension" at "1.5.4" for ios Fetching plugin "cordova-admobsdk@~7.35.0" via npm Error during untar for /Users/gimlet/.cordova/lib/npm_cache/cordova-admobsdk/7.35.0/package.tgz: Error: EACCES: permission denied, open '/Users/gimlet/.cordova/lib/npm_cache/cordova-admobsdk/7.35.0/package/GoogleMobileAds.framework/GoogleMobileAds' Failed to install 'cordova-plugin-admobpro': CordovaError: Failed to fetch plugin cordova-admobsdk@~7.35.0 via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Error: EACCES: permission denied, open '/Users/gimlet/.cordova/lib/npm_cache/cordova-admobsdk/7.35.0/package/GoogleMobileAds.framework/GoogleMobileAds' at /usr/local/lib/node_modules/pgb-plugman-151/node_modules/pgb-cordova-lib/src/plugman/fetch.js:215:37 at _rejected (/usr/local/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:797:24) at /usr/local/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:823:30 at Promise.when (/usr/local/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:1035:31) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:741:41) at /usr/local/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:557:44 at flush (/usr/local/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:108:17) at process.internalTickCallback (internal/process/next_tick.js:70:11) Failed to fetch plugin cordova-admobsdk@~7.35.0 via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Error: EACCES: permission denied, open '/Users/gimlet/.cordova/lib/npm_cache/cordova-admobsdk/7.35.0/package/GoogleMobileAds.framework/GoogleMobileAds' - You can fix this here

Any help would be appreciated ...

SLYtiger16 avatar Dec 06 '18 22:12 SLYtiger16

I have problems i try get reward in video reward but freeze and no show reward. Im use cordova 6.5.0 api Android 26 admobpro lady version.

lordStrider avatar Mar 04 '19 19:03 lordStrider

@floatinghotpot I'm seeing the same thing as @mauricioLopezRamirez. Test banner ads work in Android but changing over to live ads I see nothing. I've verified the type of add associated with the ad id matches in Admob and in my app. I did change my build.gradle file to use compile "com.google.android.gms:play-services-ads:+" and project.properties to have cordova.system.library.6=com.google.android.gms:play-services-ads:+ in order to get around the build issues when building my Ionic app. Running admobpro version 2.37.2

bnolan001 avatar Mar 11 '19 03:03 bnolan001

If you guys can see the test ads, it means the SDK and plugin are both working fine.

The only different is, the test ad unit id is from Google test team, the live ad unit id is created by your own.

Please ensure:

  1. your ad unit id is created for the exact platform (ios/android) and type (banner/interstitial/video).
  2. run the app on real device, not simulator.
  3. some dev guys cannot see live ad in his country just because there is no advertiser buying ad at that time, while other users installed the same app can see live ad in other countries. (I've tested and confirm that possibility by installing app from a dev guy).

floatinghotpot avatar Mar 11 '19 09:03 floatinghotpot

@floatinghotpot test Ads not show in ios phone. And not error... Please help me

bachdienquan avatar Mar 11 '19 09:03 bachdienquan

Please find the Google test ad units here: https://developers.google.com/admob/android/test-ads https://developers.google.com/admob/ios/test-ads

floatinghotpot avatar Mar 11 '19 09:03 floatinghotpot

@floatinghotpot I using <plugin name="cordova-plugin-admobpro" spec="^2.37.2"> <variable name="PLAY_SERVICES_VERSION" value="16.0.0" /> </plugin>

document.addEventListener('deviceready', onDeviceReady.bind(this), false);

    function onDeviceReady() {
 navigator.splashscreen.hide();
        // Handle the Cordova pause and resume events
        document.addEventListener('pause', onPause.bind(this), false);
        document.addEventListener('resume', onResume.bind(this), false);
 
            initAd2();
    };
function initAd2(){
    var admobid = {};
      if( /(android)/i.test(navigator.userAgent) ) {
        admobid = {
          banner: 'ca-app-pub-XX/XXX',
          interstitial: 'ca-app-pub-XX/XX'
        };
      } else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
 admobid = {
 banner: 'ca-app-pub-XX/XX',
 interstitial: 'ca-app-pub-XX/X'
 };
      } else { // for windows phone
        admobid = {
          banner: 'ca-app-pub-XX/XX',
          interstitial: 'ca-app-pub-XX/XX'
        };
      }
    if (! AdMob ) {  return; }

      // this will create a banner on startup
      AdMob.createBanner( {
        adId: admobid.banner,
        position: AdMob.AD_POSITION.BOTTOM_CENTER,
        isTesting: true , // TODO: remove this line when release
        overlap: false,
        offsetTopBar: false,
        bgColor: 'black'
      } );
}

In Staging/ config.xml write

<feature name="AdMob">
        <param name="ios-package" value="CDVAdMobPlugin" />
        <param name="onload" value="true" />
    </feature>

But not show Ads in iphone device... May be my code error?

bachdienquan avatar Mar 12 '19 08:03 bachdienquan

Please use this "index.html" to test on your phone. https://github.com/floatinghotpot/cordova-admob-pro/blob/master/test/index.html

floatinghotpot avatar Mar 12 '19 08:03 floatinghotpot

I just change code to your index.html file. But not have any Ads...perhap,

`admobsimple voduchien$ cordova plugin add com.google.cordova.admob
npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 'com.google.cordova.admob' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! 404 
npm ERR! 404  'com.google.cordova.admob@latest' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because 
npm ERR! 404  1. name can only contain URL-friendly characters
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:`

bachdienquan avatar Mar 12 '19 08:03 bachdienquan