ClassCastException:ApiVersionImpl 不能被强制转换为 java.lang.Integer
我有android + gradle项目。当我尝试启动应用程序时,出现以下异常:
'ClassCastException: com.android.build.gradle.internal.model.ApiVersionImpl cannot be cast to java.lang.Integer: com.android.build.gradle.internal.model.ApiVersionImpl cannot be cast to java.lang.Integer'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.+'
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile files('libs/android-support-v4.jar')
compile 'org.androidannotations:androidannotations-api:3.0.1'
apt 'org.androidannotations:androidannotations:3.0.1'
}
android {
compileSdkVersion 15
buildToolsVersion '19.1'
defaultConfig {
minSdkVersion 15
targetSdkVersion 15
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}