3

Google Play now require you to fill out an Ad Declaration for all apps distributed through Google Play. I updated my apps to "Not ad supported" and Google responded that it found an ad SDK in my app, AdMob 350.

They accepted the no ad declaration even with that there so it is not essential, but is there a way to exclude that from the build as I am not using it?

Shai Almog
  • 51,749
  • 5
  • 35
  • 65

2 Answers2

0

Codename One includes Google Play Services by default in builds since 3.2.

Play services include many nice features such as improved location, IAP etc. they also ship with admob integrated.

You can remove google play services from inclusion by setting the android.includeGPlayServices=false build hint.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • 1
    *Codename One includes Google Play Services by default* that is an unbelievably bad feature – Tim Jan 07 '16 at 11:29
  • Why? Can you elaborate on that? – Shai Almog Jan 07 '16 at 11:30
  • Because it is an immensely huge library. If you have a big app and you include the entire play services library you are almost guaranteed to exceed the limit of 65k methods, and then you'll get errors. It is better to only include the parts of the library that you are actually using in your app – Tim Jan 07 '16 at 11:31
  • We obfuscate everything by default too so it reduces some of the size. If a developer wants to remove the library he can as explained above. We have some pretty huge apps that do need the multidex flag but those are indeed huge. Not all of GPS is included only the important/relevant ones. – Shai Almog Jan 07 '16 at 11:33
  • 1
    Alright, I trust you know what you're doing, since it's your platform – Tim Jan 07 '16 at 11:34
  • Thanks for the headsup though. Its always good knowing someone is checking! – Shai Almog Jan 07 '16 at 11:37
0

I'm assuming you have the entire google play service as a dependency in your app.

From Google Play Services version 6.5 and beyond you can select which individual APIs you want to use, and import just those ones.

This is the entire list

Google+                         com.google.android.gms:play-services-plus:6.5.+
Google Account Login            com.google.android.gms:play-services-identity:6.5.+
Google Activity Recognition     com.google.android.gms:play-services-location:6.5.+
Google App Indexing             com.google.android.gms:play-services-appindexing:6.5.+
Google Cast                     com.google.android.gms:play-services-cast:6.5.+
Google Drive                    com.google.android.gms:play-services-drive:6.5.+
Google Fit                      com.google.android.gms:play-services-fitness:6.5.+
Google Maps                     com.google.android.gms:play-services-maps:6.5.+
Google Mobile Ads               com.google.android.gms:play-services-ads:6.5.+
Google Panorama Viewer          com.google.android.gms:play-services-panorama:6.5.+
Google Play Game services       com.google.android.gms:play-services-games:6.5.+
Google Wallet                   com.google.android.gms:play-services-wallet:6.5.+
Android Wear                    com.google.android.gms:play-services-wearable:6.5.+
Google Actions
Google Analytics
Google Cloud Messaging          com.google.android.gms:play-services-base:6.5.+

Source of the list

So i guess if you add these after remove com.google.android.gms:play-services-ads (and others that you dont need) instead of com.google.android.gms:play-services (the whole bunch) you should be able to get rid of the admob related stuff (and other unwanted stuff).

Community
  • 1
  • 1
Viral Patel
  • 32,418
  • 18
  • 82
  • 110
  • The assumption is incorrect. See the discussion in the other answer. We don't currently expose the fine grained control as a build hint but that will probably be available in an upcoming update. – Shai Almog Jan 07 '16 at 14:51
  • 2
    @Virus assumption is correct. You **DO** have the entire GooglePlayServices library as a dependency in your app. It is a transitive dependency via Codename – William Jan 07 '16 at 21:34