Ionic 3 | Resolve! Failed to install ‘cordova-plugin-admob-free’: Error: Variable(s) missing: ADMOB_APP_ID

Here we will discuss an issue faced during the platform build of Ionic 3 application, having an AdMob Free plugin. You can see that error below, this issue comes when we don’t add AdMob app id in an application using AdMob Free Ionic 3 native Plugin.

Installing “cordova-plugin-admob-free” for android
Failed to install ‘cordova-plugin-admob-free’: Error: Variable(s) missing: ADMOB_APP_ID
at Object.mergeVariables (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\variable-merge.js:58:15)
at C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:315:44
at _fulfilled (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:883:30)
at Promise.promise.promiseDispatch (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:13)
at C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:624:44
at runSingle (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:137:13)
at flush (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
Variable(s) missing: ADMOB_APP_ID
[ERROR] An error occurred while running subprocess cordova.

cordova platform add android –save exited with exit code 1.

Re-running this command with the –verbose flag may provide more information.

Resolve this error by installing the AdMob Free plugin

We need to provide AdMob App ID using plugin installation

Or you can manually add following code in config.xml

Now you can build your application again without any issue 🙂

Thanks for visiting :) Let me know if you have some suggestions or feedback for this post in the comment section. Looking for any tutorial or demo on FreakyJolly, just drop me a message here

Leave a Reply

Notify of