0

Since when I updated Android Studio, My app doesn't work as it functions before the update.

I've already tried to delete the cache folder

That's the code:

       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'
}
Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
  • What happens? Errors? Describe the problem. – Oliort UA May 05 '19 at 14:09
  • When i run my application, this error appear: ERROR: The 'java' plugin has been applied, but it is not compatible with the Android plugins . – Daniele Rossi May 05 '19 at 14:10
  • Take a look at this: https://stackoverflow.com/questions/26861011/android-compile-error-java-plugin-has-been-applied-not-compatible-with-android. I don't see `apply plugin: 'java'` in your code block but maybe you just did not include it in your code listing? – Oliort UA May 05 '19 at 14:16
  • Thank you Oliort, but there is apply plugin: 'com.android.application' in my code, it's not required to apply your plugin with this, as you can see in the question you linked. I'v already tried by the way, but it gives me the same error – Daniele Rossi May 05 '19 at 14:23
  • It says the opposite: `java` plugin is not compatible with `com.android.application`. But if you do not have that `apply plugin: 'java'` - maybe it is applied implicitly or some other way in your program? – Oliort UA May 05 '19 at 14:30

1 Answers1

1

The ANTLR plugin antlr extends the Java plugin java (and applies it implicitly), and you cannot apply both the com.android.application and the java plugins in the same module, so you get the error

The 'java' plugin has been applied, but it is not compatible with the Android plugins .

Try to remove the line apply plugin: 'antlr'.

Oliort UA
  • 1,568
  • 1
  • 14
  • 31