Epoxy: Deprecation of android-kotlin-extensions - specifically Parcelize.

Created on 2 Nov 2020  路  5Comments  路  Source: airbnb/epoxy

android-kotlin-extensions is being deprecated in the latest releases of kotlin (1.4.20).
https://proandroiddev.com/migrating-the-deprecated-kotlin-android-extensions-compiler-plugin-to-viewbinding-d234c691dec7

When attempting to update my app - I ran into an issue building:
```> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable

Duplicate class kotlinx.android.parcel.IgnoredOnParcel found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.Parceler found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.Parceler$DefaultImpls found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.Parcelize found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.RawValue found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.TypeParceler found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.WriteWith found in modules jetified-kotlin-android-extensions-runtime-1.4.10 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
```

On doing some digging, the only other usage I can find for Parcelize is within epoxy where the kotlin version is locked to 1.4.10, and android-kotlin-extensions is still in use.
specifically here:
https://github.com/airbnb/epoxy/blob/3905f50321b98ad296b4d058b765ebf1fb5f4dea/epoxy-adapter/src/main/java/com/airbnb/epoxy/stickyheader/StickyHeaderLinearLayoutManager.kt#L13

Are there any plans to update kotlin version and remove the dependency on android-kotlin-extensions?

Most helpful comment

same ^ with 4.3.1

All 5 comments

We can try to include this fix in the new release. If anyone wants to contribute a PR for it it would expedite the process :D

I've included the fix in 4.2.0 - artifacts are being pushed now and should be available shortly.

https://github.com/airbnb/epoxy/pull/1085

still facing this issue
Duplicate class kotlinx.android.parcel.IgnoredOnParcel found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.Parceler found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.Parceler$DefaultImpls found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.Parcelize found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.RawValue found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.TypeParceler found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)
Duplicate class kotlinx.android.parcel.WriteWith found in modules jetified-kotlin-android-extensions-runtime-1.4.20 (org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.20) and jetified-kotlin-parcelize-runtime-1.4.20-RC (org.jetbrains.kotlin:kotlin-parcelize-runtime:1.4.20-RC)

same ^ with 4.3.1

solved with this version
epoxy : 4.1.0
kotlinVersion : 1.4.10

Was this page helpful?
0 / 5 - 0 ratings