Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecyclerView skeleton screen is crashing app when shimmer_color is not defined #13

Closed
pgreze opened this issue Apr 6, 2018 · 3 comments

Comments

@pgreze
Copy link

pgreze commented Apr 6, 2018

Version: 1.1.0

AndroidRuntime: java.lang.NoSuchFieldError: No static field shimmer_color of type I in class Lcom/ethanhua/skeleton/R$color; or its superclasses (declaration of 'com.ethanhua.skeleton.R$color' appears in /data/app/io.zla.app.dev-Vy5HPDU23Z-PLz_xYaxCWw==/base.apk!classes3.dex)
AndroidRuntime: 	at com.ethanhua.skeleton.RecyclerViewSkeletonScreen$Builder.<init>(RecyclerViewSkeletonScreen.java:62)
AndroidRuntime: 	at com.ethanhua.skeleton.Skeleton.bind(Skeleton.java:13)
@ethanhua
Copy link
Owner

ethanhua commented Apr 8, 2018

@pgreze I think you have also a resource color called shimmer_color and it's causing conflicts with Skeleton with the same name.

@pgreze
Copy link
Author

pgreze commented Apr 8, 2018

@ethanhua If I remember correctly, this issue happened after I renamed my shimmer_color to shimmer.
I think it's showing than https://github.com/ethanhua/Skeleton/blob/master/library/src/main/java/com/ethanhua/skeleton/RecyclerViewSkeletonScreen.java#L62 is relying on Android weird resources fallbacks, leading to an unstable user experience.

I don't have a specific fix to advise but I finally decided to fork your good library into my project, in order to avoid similar unwritten defaults.
Thanks for your hard work, especially your recycler view binder.

@shivangbtech
Copy link

I am using data binding and for recycler view I am using the collection adapter library:
https://github.com/evant/binding-collection-adapter

Getting error:

java.lang.ClassCastException: com.ethanhua.skeleton.SkeletonAdapter cannot be cast to me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter
at me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapters.setAdapter(BindingRecyclerViewAdapters.java:19)
at com.coroutinedemo.databinding.FragmentTodoListBindingImpl.executeBindings(FragmentTodoListBindingImpl.java:209)

please help to get rid of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants