Reputation: 31
I want to compile an android app using build tools 21.1+ since I need to use multidex support. I installed the build tools 21.1.2 from the SDK manager. After that I changed ALL my build.gradle files to include the buildToolsVersion:
android {
...
buildToolsVersion "21.1.2"
...
}
Since the app depends on several other projects, there are several build.gradle files, with different versions and params.
Also, did the other changes necessary for the multidex. In the app that needs the multidex I modified the build.gradle like this :
android {
...
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
// Enabling multidex support.
multiDexEnabled true
}
...
}
And of course modified the manifest to.
The problem is that despite of all the build.gradle modifications, the project seems to be compiling with the 19.1.0 build tools, because when I remove them, I get this error:
> failed to find Build Tools revision 19.1.0
When I install the build tools 19, the project goes further in the compilation process, but it gets all kind of different bizarre errors, depending on the compilation parameters. If I set:
minSdkVersion 15
targetSdkVersion 21
The project fails to compile with bizarre errors during the dex process. but if I set both to v 21, the project fails to compile because it says it requires build tools 21.0+, which I explicitly required in the build.gradle.
Since the project originally was developed like that, I'm using a gradle wrapper (gradlew), instead of the built in gradle of Android Studio.
Note, the following is not relevant to the technical part of the bug, but maybe it helps to understand the context of it: I'm trying to compile the ros-android (android_core) library, but updating all to the latest : gradle 2.3, android plugin 1.1.0, build tools 21.1.2, Google APIs 21, android studio 1.1.0. The idea is to be able to use the latest Google APIs in conjunction with the ros-android library.
Upvotes: 1
Views: 3139
Reputation: 31
This was a tricky one. The problem was that the buildtools were not being setted by the build.gradle as we expected. Instead, there was another plugin (rosjava android) which was calling the gradle build. The problem is that this plugin has the build tools version "hard coded" so it was impossible to change them without recompiling everything.
Gladly, the author of the library has updated everything in the last few days, including the buildtools version and the maven repo. So the problem is now gone.
Upvotes: 1