Exception: No signature of method android() is applicable for argument types, Build Gradle // Dev Diary

Today I wanted to make a data class a Parcelable so that I could pass it as an argument in Navigation component.

Parcelables, though better in performance than Serializables, take more time to implement! To help us out, there’s a “kotlin-parcelize” plugin that can generate the boilerplate code for us.

There were issues though.

After applying the kotlin-parcelize plugin, I was getting the error:

'kotlin-parcelize' can't be applied together with 'kotlin-android-extensions'

So kotlin-parcelize is like a “successor” to the now deprecated 'kotlin-android-extensions' that I’m still using. So I replaced 'kotlin-android-extensions' with ‘kotlin-parcelize’.

I got another error after attempting to sync with my Gradle files:

The solution was to remove the following code from my android{} block:

After removing that, Gradle synced successfull!

References:
Parcelable implementation generator
How to use @Parcelize now that kotlin-android-extensions is being deprecated?

Related Posts:

Posts that may be related to "Exception: No signature of method android() is applicable for argument types, Build Gradle // Dev Diary":

Catzie

An odd human being who happens to have a variety of ever-changing interests, but right now they are programming, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert/drink flavors, obsessing about finding out how some things works, automation, anime, video games... Ran online dessert shops Cookies PH and Catzie's Cakery in her past life.

Leave a Reply

Your email address will not be published. Required fields are marked *