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

Using "requireCordovaModule" to load non-cordova module "q" is not supported

Open ojimenez-aeropost opened this issue 6 years ago • 9 comments

Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it. cordova 9

ojimenez-aeropost avatar Sep 21 '19 22:09 ojimenez-aeropost

I have the same issue. Is there a solution for this?

rob-baker avatar Oct 17 '19 21:10 rob-baker

I found a solution for this, you have to change de "requireCordovaModule" method in script/100-prepare-admob-angular.js, there is 2 places to change, on line 7 and 61: change: var deferred = new context.requireCordovaModule('q').defer(); to var deferred = require('q').defer();

antalag avatar Nov 15 '19 09:11 antalag

i tried antalag method by editing script/100-prepare-admob-angular.js with Visual Studio Code. But still getting same err.

cordova 9, android 8

saYRam avatar Nov 25 '19 11:11 saYRam

facing the same issue with cordova 9

moblizeit avatar Dec 06 '19 05:12 moblizeit

Same here. I resolved mine by downgrading cordova from version 9.0.0 to 8.1.2. Hope this helps.

snow-drop avatar Dec 26 '19 16:12 snow-drop

the same issue. Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

    "cordova-admob": "^5.1.0",
    "cordova-android": "^8.1.0",
    "cordova-browser": "^6.0.0",
    "cordova-connectivity-monitor": "^1.2.2",
    "cordova-ios": "^5.1.1",
    "cordova-libgoogleadmobads": "git+https://github.com/appfeel/google-iosadmobads.git",
    "cordova-play-services-version-adapter": "^1.0.2",
    "cordova-plugin-androidx": "^1.0.2",
    "cordova-plugin-androidx-adapter": "^1.1.0",
    "cordova-plugin-contacts": "^3.0.1",
    "cordova-plugin-facebook4": "6.2.0",
    "cordova-plugin-firebasex": "^6.1.0",
    "cordova-plugin-inappbrowser": "^3.1.0",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-wkwebview-engine": "git+https://github.com/apache/cordova-plugin-wkwebview-engine.git#master",
    "cordova-plugin-x-socialsharing": "^5.6.0",
    "cordova.plugins.diagnostic": "^5.0.1",
    "es6-promise-plugin": "^4.2.2"

charlie-cao avatar Feb 14 '20 13:02 charlie-cao

I am also seeing this issue. Did anyone find a solution without modifying the core code?

scottopolis avatar Feb 14 '20 22:02 scottopolis

Having this issue as well. Would be nice if dev could respond considering they're taking a portion of the ad revenue ... >.> COME ON DEVS!

PixelKnight1398 avatar Feb 18 '20 01:02 PixelKnight1398

Search for string requireCordovaModule inside cordova-admob and cordova-play-services-version-adapter inside plugins folder. And replace ctx.requireCordovaModule('q').defer() or new context.requireCordovaModule('q').defer() with simply require('q').defer();

ankit257 avatar Mar 06 '20 04:03 ankit257