Reputation: 153
I use in my project ColorPickerPreference library and until today everything worked well . But now I see the compilation error
Error:(1, 0) Cause: com/android/build/gradle/LibraryPlugin : Unsupported major.minor version 52.0
in file
MyPath\AndroidStudioProjects\MyApp\app\libs\ColorPickerPreference\ColorPickerPreference\build.gradle
echo %JAVA_HOME% show me C:\Program Files\Java\jdk1.7.0_79
and java -version
java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
As I understand this dependencie uses a different version of Java but why I have no problems before? And how I can fix it?
just in case show ColorPickerPreference\build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 7
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Thank you.
Upvotes: 2
Views: 872
Reputation: 153
I solved this problem. It appears in app/build.gradle and in app/libs/ColorPickerPreference/build.gradle was
classpath 'com.android.tools.build:gradle:+'
I changed to a specific version classpath 'com.android.tools.build:gradle:2.1.0'
and it helped.
Upvotes: 2