No signature of method: .android() is applicable for argument types. Exception in build.gradle (app)

  • Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app'

Caused by: groovy.lang.MissingMethodException: No signature of method: build_h12dou32x8mktsbcdinr8fpc.android() is applicable for argument types: (build_h12dou32x8mktsbcdinr8fpc$_run_closure1) values: [build_h12dou32x8mktsbcdinr8fpc$_run_closure1@1630dea1]


Solution 1:

I had the same issue when migrating to the AGP 7.0 when moving from aaptOptions to androidResources.

For me it was enough to replace

androidResources {
   noCompress '...'
}

with

aaptOptions {
   noCompress '...'
}

Solution 2:

I had the same issue when migrating to the 'com.android.tools.build:gradle:7.0.0'

I removed the code:

javaCompileOptions {
            annotationProcessorOptions {
                arguments = [fragmentArgsLogWarnings: 'false']
                includeCompileClasspath true
            }
        }

here is desc about how to add it again for kapt https://github.com/sockeqwe/fragmentargs#annotation-processor-options

Solution 3:

In my case, there was an unwanted character(a semicolon) in build.gradle(app)

I deleted that and rebuiled the project

problem solved.

Solution 4:

I was using - (in build.gradle) "versionCode" as RN-2 (* as i was developing in React Native) then i tried "versionCode" as 3.1 but that also was throwing error then i used - versionCode 4

and this time the BUILD was SUCCESSFUL

my learning -> versionCode should be integer*