I want to include this Color Picker into my Android Studio project.
So I checked it out into a local folder, added it to my project with the "New->Import Module Dialog in Android Studio.
Then I added those 2 lines to my app.gradle file
apply plugin: 'com.android.application'
...
compile project(':colorpicker')
Here is the complete gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.2'
defaultConfig {
applicationId "com.mydomain.myapp"
minSdkVersion 17
targetSdkVersion 24
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile fileTree(include: ['dtp_library'], dir: 'libs')
compile project(':libs:dtp_library')
compile 'com.android.support:design:24.2.1'
compile project(':colorpicker')
}
But I keep getting the error
Error:Cause: buildToolsVersion is not specified.
If I do not add the first line to the gradle file (do it exactly like the color picker description said) then I get
Error:(3, 0) Could not find method android() for arguments [build_xxxxx] on project ':app' of type org.gradle.api.Project.
How to fix it?
Follow the steps :
Open the build.gradle
file of color picker module
so in your case add these lines to build.gradle
file of colorpicker
module
compileSdkVersion 24
buildToolsVersion '24.0.2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With