janheinrichmerker / material-intro

A simple material design app intro with cool animations and a fluent API.
https://jitpack.io/#com.heinrichreimer/material-intro
MIT License
1.74k stars 307 forks source link

Databinding cast that crashes the app? #256

Closed ghost closed 5 years ago

ghost commented 6 years ago

Hey there, Whenever I attempt to extend to app/IntroActivity class, i get this weird exception that seems to be casting the bindings generated for my package and the library's package? It crashes the app.

Caused by: java.lang.ClassCastException: me.morgy.fish.databinding.MiActivityIntroBindingImpl cannot be cast to com.heinrichreimersoftware.materialintro.databinding.MiActivityIntroBinding

ghost commented 6 years ago

wait what the fuck i didn't realize i had another class with the same name omg ._.

ghost commented 6 years ago

Wait a min i saw wrongly there is a issue rip

haliyari commented 6 years ago

i have the same problem

chimbori commented 6 years ago

See also #257 .

This crash has recently started to happen with 100% reproducibility. I suspect it might be related to upgrading Gradle from 4.4 to 4.6 as recommended by the latest version of Android Studio 3.1.4 & unexpected interactions with Data Binding.

I see that work is already underway to remove the dependency on Data Binding (c60b78d87ecaa73a84f630c9ace3a32c1fafa297), which would be awesome, because having a library add a dependency for trivial task seems like overkill.

Is there a plan to issue a new release without data binding, which would side-step this issue?

Or, if not, then is there a plan for a surgical fix to avoid these crashes for everyone using the library with the latest Android Studio + Gradle versions? Thanks!

chimbori commented 6 years ago

Until this is fixed, reverting to version 1.6 seems to be an acceptable workaround. Documenting in case others find this useful!

edotassi commented 6 years ago

any news?

doilio commented 6 years ago

Same error here. any updates on how to fix this?

ghost commented 6 years ago

I'll leave a pr after exams, I should be able to fix this

Inversion-NL commented 6 years ago

Until this is fixed, reverting to version 1.6 seems to be an acceptable workaround. Documenting in case others find this useful!

Updating to 1.6 didn't help. Currently running 1.5.8 looks like it did the trick.

Thanks for the library!

ferrannp commented 6 years ago

Wop! Having this issue in all my devices. What is actually happening?

AnuthaDev commented 6 years ago

I am getting exactly this error. It wwas working fine before with AS 3.1.4, Gradle 4.1, AGP 3.1.4. But today, I updated to AS 3.2, Gradle 4.6, AGP 3.2.0 and it started giving errors... Please someone fix this.

EpsilonOrionis commented 6 years ago

Please fix

akashpathak commented 6 years ago

Anyone have a work around? Downgrading to 1.5.8 did not work for me.

Unpublished commented 6 years ago

Updating to latest master commit (com.heinrichreimersoftware:material-intro:7221502f1f) solves it but may be unstable.

AnuthaDev commented 6 years ago

I downgraded to 1.6 with Gradle 4.6 and it worked for me

doilio commented 6 years ago

I downgraded to 1.6 with Gradle 4.6 and it worked for me

implementation 'com.heinrichreimersoftware:material-intro:1.6' So far, It's Working for me as well. No luck with 1.6.1

captainepoch commented 5 years ago

With AS 3.2, Kotlin 1.2.71 and Gradle 4.6, the downgrade to the 1.6 seems to be a hack to get it working

ferrannp commented 5 years ago

Yeah although version 1.6.0 has more bugs than 1.6.1 (like wrong button colors on Lollipop).

Spiderbezno commented 5 years ago

I have the same problem since I updated to Gradle version, is there any fix?

philbour commented 5 years ago

This is causing my app to crash for all my users, since I updated android studio and gradle. Really need it fixed

allato commented 5 years ago

Updating to latest master commit (com.heinrichreimersoftware:material-intro:7221502f1f) solves it but may be unstable.

Could you TAG last commit with a new subversion to update every project? Tnk for your job

anisias commented 5 years ago

I tried different options listed above and what worked for me is this combination:

simonesessa commented 5 years ago

Works with gradle 4,4 and 'com.android.tools.build:gradle:3.1.0'. Is there a fix for gradle 4.6?

Aym9n commented 5 years ago

Same here Downgraded library to 1.6 with Gradle 4.6 and it worked. any fixes for 1.6.2?

msahil432 commented 5 years ago

Using 1.6, solved my issue. I am using AS 3.3 and com.android.tools.build:gradle:3.3.0

VladimirWrites commented 5 years ago

https://github.com/heinrichreimer/material-intro/issues/261#issuecomment-470543841

chimbori commented 5 years ago

Data binding dependency has been removed, thanks @meierjan : ebc6b7192d5586fad7a170e0a24788cd8bb41f41