我需要从Android Studio迁移到IntelliJ IDEA,因为我需要在Java中进行其他一些非Android的工作.我从git克隆了我的项目,并将其导入到IDEA中.但是,我在此过程中遇到了Gradle错误.我已经搜索过,但是找不到解决我的错误的答案.
这是事件日志
03:39:42 PM All files are up-to-date
03:39:42 PM 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
settings.gradle(myproject是SO的示例,想要省略实际名称)
include ':myproject'
根目录中的build.gradle(例如/myproject/build.gradle)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
和另一个build.gradle(例如/myproject/myproject/build.gradle)
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '20'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
versionNameSuffix "-alpha"
}
}
productFlavors {
}
packagingOptions{
exclude 'META-INF/DEPENDENCIES.text'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'commons-validator:commons-validator:1.4.0'
}
我认为这与Gradle版本有关,或者Studio和IDEA之间不兼容,但我不确定.高度赞赏的答案.谢谢.