I was building an admob integration mobile app. And I keep getting the following error on build.
UserError: This project uses AndroidX dependencies, but the ‘android.useAndroidX’ property is not enabled. Set this property to true in the gradle.properties file and retry. You can fix this by adding this line to config.xml:
The thing is, when I add the entry it says I should set it to “false” and this is resolved in Cordova 11. - Any else have this issue? Is there a better Admob plugin I should use?
I emailed my last build log. What build versions are you using? I see this when I enabled this variable, and target Cordova v9. If I target 10.1, I get a Gradle error I sent in the email.
Lastly, where do you specify the APPID? And what should the variable name be called? The log shows it in the package.json. (APP_ID_ANDROID) Admob Google Docs specify it should be in AndroidManifest.xml. (APPLICATION_ID)
From what I gathered, when the plugin is installed, it should be included like this: Where the ID’s are pulled from the AndroidManifest.xml variables of the same name, instead of Google’s default name. (Hope this helps.)
Both cordova android engines 9 and 10 are very old at this point. We will be dropping support for 9 soon. 14 is just about to be released. I would suggest targeting 13 if possible.