Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify which android build tools version in Maven

Looks like the Android Maven plugin always uses the latest build tools version by default. Is there a way to specify a specific version?

This link seems to indicate so but I can't figure out how to specify the value in my POM file.

https://github.com/simpligility/android-maven-plugin/commit/a52d218964b0fa75db751954b15e316f5b0d3aa4

like image 205
PsychicPuppy Avatar asked Jun 17 '16 17:06

PsychicPuppy


People also ask

How to get the latest build tools version for Android plugin?

By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using. Show activity on this post. You can get the latest buildToolsVersion from SDK Manager in Android Studio.

Do I need to specify a version for the build tools?

You no longer need to specify a version for the build tools. By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using. Show activity on this post.

How do I specify a minimum version of the Android platform?

If your app requires a specific minimum version of the Android platform, you can specify that version requirement as API level settings in the app's build.gradle file. During the build process, these settings are merged into your app's manifest file.

How do I build Cordova apps with Gradle?

In native Android applications, the version of build tools and SDK to build them with can be specified directly in the Gradle build script: In Cordova applications, the build file is automatically generated, therefore any manual changes to it will be overwritten.


1 Answers

Starting from version 4.3.0, you can specify a build tools version at the configurations section of the android plugin. For example:

<plugin>
    <groupId>com.simpligility.maven.plugins</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>4.4.3</version>
    <extensions>true</extensions>
    <configuration>                    
      <sdk>
        <platform>25</platform>
        <buildTools>25.0.2</buildTools>
      </sdk>
    </configuration>         
</plugin>
like image 94
Anton Klimov Avatar answered Nov 14 '22 23:11

Anton Klimov