My project consists of two modules: one is an application module and the other is a library module. My build processes work fine until I added two gradle :
This is the root of build.gradle :
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
This is the build.gradle library module:
apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' android { compileSdkVersion 24 buildToolsVersion "24.0.0" resourcePrefix "looping_banner_res_" defaultConfig { minSdkVersion 16 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile 'com.android.support:support-v4:24.1.0' }
I don't think that something is wrong with the build files, but I got an error when I run gradle clean :
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence. java.lang.IllegalStateException: buildToolsVersion is not specified. at com.google.common.base.Preconditions.checkState(Preconditions.java:176) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:606) at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:572) at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:569) at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55) at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47) at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:568) at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:565) * Where: Build file '/home/lic/code/private/github/looping-banner/banner/build.gradle' line: 3
Why did this problem arise and how to solve it?
I was looking for some answer, but it didn’t work for me, is there something wrong with the two plugins that I import?
user6617365
source share