Skip to content Skip to sidebar Skip to footer

Could Not Find Method Compileoptions() For Arguments

The error appears: Could not find method compileOptions() for arguments [build_88ddjipq2tquhqjwgj0asxwi4$_run_closure3@5ddee9dd] on project ':app' of type org.gradle.api.Proj

Solution 1:

Put compileOptions inside android tag like this :

android {
......
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

EDIT: To be exact

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Post a Comment for "Could Not Find Method Compileoptions() For Arguments"