anyone here using the `@Parcelize` annotation from...
# android
t
anyone here using the
@Parcelize
annotation from the 1.1.4 android extensions? It doesn't seem to work for me, I always get a compiler error:
error: cannot find symbol CREATOR = null
k
Did you apply the
kotlin-android-extensions
plugin? And enable experimental extensions?
It works just fine for me. True, there are issues with it. But non of this kind
t
I did. What kind of issues are you having?
can you post your build.gradle and an example how you use it?
@kingsley
s
try to update plugin for android studio simple smile
1
k
I haven’t done anything differently. Build.gradle has this:
Copy code
apply plugin: 'kotlin-android-extensions'

androidExtensions {
    experimental = true
}
And I use like this:
Copy code
@Parcelize
class User(val firstName: String, val lastName: String) : Parcelable
Issues: 1. Generated code doesn’t currently take nullability into consideration 2. There’s currently no way to specify custom serializers, you’d have to resort to doing the whole thing manually But of course, it’s the initial release and it’s still experimental, so this is okay
t
weird, I do exactly the same. But it doesn't work neither with the simplest data classes nor normal classes
k
Did you update your Android Studio plugin? ^^ Also try to build directly with gradle see if it makes any difference