Trouble With Build Android


#1

hello

to resume, i try to build my project into android and he tell me build fail because AdMob plugin i think but this is what they said :
compileDebugJava/Users/chocho/Desktop/Nabr/platforms/android/src/com/rjfun/cordova/plugin/AdMob.java:219: error: cannot find symbol
((ViewGroup) webView.getRootView()).addView(adViewLayout, params);
^
symbol: method getRootView()
location: variable webView of type CordovaWebView
/Users/chocho/Desktop/Nabr/platforms/android/src/com/rjfun/cordova/plugin/AdMob.java:411: error: cannot find symbol
ViewGroup parentView = (ViewGroup) webView.getParent();
^
symbol: method getParent()
location: variable webView of type CordovaWebView

By The way it s work fine on iOS i buld it and deploy it

Thank you


#2

That’s normal java code of the plugin is only for Android.

Anyway, this is not an ionic issue, it’s a plugin issue and it seems to be a known one.

Basically they say; If you are using cordova CLI 5.0 (which is what ionic uses), please migrate to cordova-plugin-admobpro

ngCordova has {an issue about it](https://github.com/driftyco/ng-cordova/issues/360) so it seems that you should use com.google.cordova.admob and $cordovaGoogleAds