Android studio错误:已应用java插件,但与Android插件不兼容
因为当我更新Android Studio时,我的应用程序在更新之前无法正常工作 我已尝试删除缓存文件夹 这就是代码:Android studio错误:已应用java插件,但与Android插件不兼容,java,android,gradle,Java,Android,Gradle,因为当我更新Android Studio时,我的应用程序在更新之前无法正常工作 我已尝试删除缓存文件夹 这就是代码: apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId 'daxilgames.footballplayersquiz2019' minSdkVersion 17
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId 'daxilgames.footballplayersquiz2019'
minSdkVersion 17
targetSdkVersion 28
apply plugin: 'jdepend'
apply plugin: 'antlr'
apply plugin: 'announce'
apply plugin: 'com.android.application'
versionCode 3
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable false
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-ads:11.0.4'
testImplementation 'junit:junit:4.12'
}
ANTLR插件扩展了Java插件
Java
(并隐式地应用它),您不能在同一个模块中同时应用com.android.application
和Java
插件,因此会出现错误
已经应用了“java”插件,但它与Android插件不兼容
尝试删除行
apply plugin:'antlr'
会发生什么?错误?描述问题。当我运行应用程序时,会出现以下错误:错误:“java”插件已应用,但它与Android插件不兼容。请查看以下内容:。我没有在你的代码块中看到应用插件:“java”,但也许你只是没有将其包含在代码列表中?谢谢你的支持,但我的代码中有应用插件:“com.android.application”,你不需要用它来应用你的插件,正如你在链接的问题中看到的那样。顺便说一句,我已经试过了,但它给了我同样的错误,它说的恰恰相反:java
插件与com.android.application
不兼容。但是,如果您没有应用插件:'java',那么它可能是隐式应用的,或者在您的程序中以其他方式应用的?