【发布时间】:2019-05-05 12:49:14
【问题描述】:
自从我更新 Android Studio 后,我的应用程序无法正常运行,因为它在更新之前可以正常运行。
我已经尝试删除缓存文件夹
代码如下:
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'
}
【问题讨论】:
-
会发生什么?错误?描述问题。
-
当我运行我的应用程序时,出现这个错误:ERROR: The 'java' plugin has been applied, but it is not compatible with the Android plugins .
-
看看这个:stackoverflow.com/questions/26861011/…。我在您的代码块中没有看到
apply plugin: 'java',但也许您只是没有将它包含在您的代码清单中? -
谢谢奥利奥特,但我的代码中有 apply plugin: 'com.android.application',不需要应用你的插件,正如你在链接的问题中看到的那样。顺便说一句,我已经尝试过了,但它给了我同样的错误
-
相反:
java插件与com.android.application不兼容。但是如果你没有那个apply plugin: 'java'- 也许它被隐式应用或以其他方式应用到你的程序中?