Search code examples
androidcodenameoneadsbanner

Codenameone app with banner ads - outdated version reported


I made a new version of my cn1-app, and I am trying to publish it on Google Play console. After uploading the aab file, the following error was reported:

Error: The developer of Google Mobile Ads (GMA) SDK (com.google.android.gms:play-services-ads) has reported version 12.0.1 as outdated. You must upgrade to a newer version (19.4.0+) before you can publish a new release to production.

My new version contains banner ads, while the previous version had interstitial ads (and it contained: AdmobFullScreen.cn1lib). A similar warning was reported last time (when I published the last version). But now it is not a warning but an error. I use: cn1 + netbeans + maven. I don't use any more AdmobFullScreen.cn1lib. I deleted from one pom.xml file (common - folder) the admobfullscreen - dependency. I also deleted all folders of the type: 'admob-fullscreen-' in the local maven repository. Is it possible that there are still some remains of the admobfullscreen library, or are the banner ads the cause of the above problem ? Can other people use banner ads, within a cn1 project, without any problems ?

Some build hints are:

android.playService.ads=true android.googleAdUnitId=ca-app-pub-something codename1.arg.android.licenseKey=something codename1.arg.android.xapplication=<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> codename1.arg.android.xpermissions=<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>


Solution

  • You can explicitly set the play services version as explained in this post. Although I don't think you'll need it.

    In your case I think just using the following build hint should be enough:

    android.playService.ads=true
    

    If this still doesn't work you can also add:

    android.decouplePlayServiceVersions=true
    android.playService.ads=18.0.1
    

    Original Answer Below:

    Including your android. build hints would help in diagnosing this. Also it's unclear how you include the banner ads.

    My understanding is that you don't use Googles ads anymore and just want to remove this entirely. I'm assuming that you have no definitions regarding the play services inclusion so I suggest adding at least one explicit hint to disable the default fallback. Specifically, add the build hint: android.playService.ads=false.