Error: cannot find symbol - gms ads

I recently started getting failures in my builds (even on code that used to work a few days ago or that produced a release version etc)

from the build log:

Task :app:compileDebugJavaWithJavac FAILED
/platforms/android/app/src/main/java/com/rjfun/cordova/admob/ error: cannot find symbol
symbol: class AdError
location: package

/platforms/android/app/src/main/java/com/rjfun/cordova/admob/ error: package does not exist

(I get multiple instances of “error: cannot find symbol” and “error: package X does not exist”)

I consider this link to be relevant:
admob - Error: cannot find symbol import - Stack Overflow

Thank you

Have you overridden the engine in your config.xml? Check if that is up to date(or use the default), as well as any plugins.

OK, solved!

I had used

<preference name="android-minSdkVersion" value="30" />	<!-- api level 29 = android 10.0 -->
<engine name="android" spec="10.0.1" />	<!-- needed to accept api level 30 -->

but it seems the problem was in the cordova-plugin-admobpro plugin. It got updated after about 5 years of inactivity… Changing the PLAY_SERVICES_VERSION value to 20.4.0 solved the issue for me.

<plugin name="cordova-plugin-admobpro" source="npm">
    <variable name="PLAY_SERVICES_VERSION" value="20.4.0" />
    <variable name="ADMOB_APP_ID" value="ca-app-pub-XXXXXXXXXX" />

thank you

Good work - and thank you for posting your solution!