【发布时间】:2017-10-06 11:20:36
【问题描述】:
更新SDK构建工具后,报错:
Error:(1, 1) A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
当我尝试在 Android Studio 2.3 中运行我的代码时收到以下错误消息
错误:配置项目 ':app' 时出现问题。
无法下载 junit.jar (junit:junit:4.12) 无法获取资源“https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar”。 无法获取“https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar”。 akamai.bintray.com**
build.gradle 文件:
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module:App)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "palstech.com.fitnessdroid2"
minSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
}
【问题讨论】:
-
发布您的
build.gradle。 -
@JaredBurrows 这是 build.gradle 文件:
buildscript { repositories { maven { url 'http://repo1.maven.org/maven2' } jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.1' // 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 } -
请在您的问题中发布,格式化。
-
@JaredBurrows 我已经编辑了问题,请检查。感谢您的帮助。
-
请务必发布您的两个
build.gradle文件。在allprojects块中有jcenter(),这很好。
标签: java android android-studio junit build.gradle