How to enable AAR file for Android in maven build

I created a simple Android application using the Maven build by following the steps in this link:

http://androidcookbook.com/Recipe.seam?recipeId=4137

Following the instructions in the link, I was able to create and deploy an Android application and see the output on the emulator.

Now I am trying to add an existing AAR file as a dependency in my file Maven pom.xml. So I copied the AAR file that I have in the libs directory of my project.

After searching the Internet, I found this link on how to use the AAR file in Maven - https://code.google.com/p/maven-android-plugin/wiki/AAR

It says that we can use the AAR file by adding a dependency in my pom.xml file:

<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>play-services</artifactId>
    <version>4.4.52</version>
    <type>aar</type>
  </dependency>

pom, maven :

- mvn clean install -e

:

Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find com.google.android.gms:play-services:aar:4.4.52 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

, -U , :

- mvn clean install -U -e

:

Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.google.android.gms:play-services:aar:4.4.52 in central (http://repo.maven.apache.org/maven2)

Android, - , AAR Maven?

+4

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


All Articles