diff --git a/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/AndroidGradleBuilder.java b/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/AndroidGradleBuilder.java index b1ddcf4cd5..eeb1c3f10e 100644 --- a/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/AndroidGradleBuilder.java +++ b/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/AndroidGradleBuilder.java @@ -309,7 +309,7 @@ public File getGradleProjectDirectory() { private static final Map defaultPlayServiceVersions = new HashMap<>(); static { // Defaults obtained from https://developers.google.com/android/guides/setup - defaultPlayServiceVersions.put("ads", "19.8.0"); + defaultPlayServiceVersions.put("ads", "22.6.0"); defaultPlayServiceVersions.put("ads-identifier", "18.0.1"); defaultPlayServiceVersions.put("ads-lite", "21.5.0"); defaultPlayServiceVersions.put("afs-native", "19.0.3"); @@ -1098,6 +1098,9 @@ public boolean build(File sourceZip, final BuildRequest request) throws BuildExc String googlePlayObfuscation = ""; String googleAdUnitId = request.getArg("android.googleAdUnitId", request.getArg("google.adUnitId", null)); String googlePlayAdViewCode = ""; + if (playServicesAds) { + minSDK = maxInt("21", minSDK); + } if (googleAdUnitId != null && googleAdUnitId.length() > 0) { minSDK = maxInt("9", minSDK); googlePlayAdsMetaData = "";