Android Game Services and Database (AAR) Dependencies

I found the xml file GoogleDependencyFlurryPlugin.xml

<dependencies> <dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-base</artifactId><version>8.4+</version></dependency> <dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-basement</artifactId><version>8.4+</version></dependency> </dependencies> 

and indeed the XML file GoogleDependencyPlayGameServicesPlugin.xml

 <dependencies> <dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-games</artifactId><version>8.4+</version></dependency> <dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-plus</artifactId><version>8.4+</version></dependency> </dependencies> 

Now, at some point, the old file had ONLY

play-services-base> OR <play-services-basement

and that seemed to be causing a huge problem. AndroidJavaException: java.lang.NoSuchMethodError: after starting on the device.

Android experts, is that so if you have a "base" , you should have a "basement" ... or maybe the other way around ?

In fact, WRT play-services-games or play-services-plus, maybe one / both of them somehow (or contradict?) Base / basement?

+5
source share
1 answer

The play-services-basement library is a dependency on play-services-base . It was introduced in Google Play Service version 8.1.0 to reduce the size of some other libraries, such as play-services-ads and play-services-analytics .

When you add play-services-base , you automatically add play-services-basement , so there is no need to add an explicit dependency.

You can check the dependencies of each individual library in the local Google repository.

For example, for the play-services-games library, open the pom file of the file, which is located here:

 extras/google/m2repository/com/google/android/gms/play-services-games/8.4.0/play-services-games-8.4.0.pom 

this is the contents of the file:

 <?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <groupId>com.google.android.gms</groupId> <artifactId>play-services-games</artifactId> <version>8.4.0</version> <packaging>aar</packaging> <dependencies> <dependency> <groupId>com.google.android.gms</groupId> <artifactId>play-services-base</artifactId> <version>8.4.0</version> <scope>compile</scope> <type>aar</type> </dependency> <dependency> <groupId>com.google.android.gms</groupId> <artifactId>play-services-drive</artifactId> <version>8.4.0</version> <scope>compile</scope> <type>aar</type> </dependency> </dependencies> </project> 

As you can see, play-services-games depends on play-services-base and play-services-drive

+7
source

Source: https://habr.com/ru/post/1246587/


All Articles