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

A Filipino programmer with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

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