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

We Are Going To Discuss About No signature of method: .android() is applicable for argument types. Exception in build.gradle (app). So lets Start this Java Article.

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

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

    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 '...' }

  2. android() is applicable for argument types. Exception in build.gradle (app)

    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 '...' }

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 '...'
}

Original Author Of This Content

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

Original Author Of This Content

Solution 3

Best way to deal with this is going in the android { ... } block and start commenting out different methods/blocks until the configuration moves past the .android() error and you’ll know which block is causing it. In my case it was a deprecated method in the buildTypes { ... } block.

Original Author Of This Content

Solution 4

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

I deleted that and rebuiled the project

problem solved.

Original Author Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment