-
Notifications
You must be signed in to change notification settings - Fork 202
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
MaterialRatingDrawable Crash #76
Comments
my ui
|
Could you try the sample app on those devices? If it works fine, it's probably your code/configuration causeing the crash. |
Can you share the crash stacktrace for the sample app? Definitely an OEM issue if it's only broken on OEM devices, but we may work around if we know the root cause. I don't have a Huawei device so I can't test this. My Pixel 4 XL running Android 11 runs the sample app fine. |
Sorry,the Huawei Enjoy 9 not by my side,I test the sample app through my friends,I can't get the crash stacktrace. |
This crash shows when I use the app bundle‘s version,before this I used the apk,it was never show this crash. |
Then it's probably app bundle resources not properly bundled, or app bundle resource handling broken on those devices, if APK works well. Which matches good with the exception stacktrace saying resource not fond. I haven't ventured into app bundle so I don't know much about it for now. |
Hello! I'm having a very similar issue. In my case it only happens to API Level 21 and 22 (weird) but it seems pretty related to the new app bundles. Here it is my stack trace:
It only happens when you build for release, but seems unrelated to proguard and obfuscation |
I've found the reason for this, and a solution, however I'm not entirely sure why it happens. Using a gradle version more than 4.2.2 with R8 optimization enabled (via app level Again, not entirely sure why it happens, but this approach seems to be solving it. The downside is that the APK size becomes a bit bigger. |
I solved the problem for myself by abandoning the Gradle Kotlin DSL |
Hi,there will crash on the Nexus 5x and Huawei Enjoy 9s
My MaterialRatingBar version is 1.4.0 is the latest
This is crash log
Fatal Exception: android.view.InflateException
Binary XML file line #9: Binary XML file line #51: Error inflating class com.xxx.xxx.module_base.ui.widget.ratingbar.CustomRatingBar
android.view.LayoutInflater.createView (LayoutInflater.java:633)
android.view.LayoutInflater.inflate (LayoutInflater.java:414)
com.xxx.xxx.module_base.ui.widget.adapter.BaseRecyclerViewAdapter.onCreateViewHolder (BaseRecyclerViewAdapter.java:26)
com.yanzhenjie.recyclerview.AdapterWrapper.onCreateViewHolder (AdapterWrapper.java:123)
androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder (RecyclerView.java:7046)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:698)
Caused by android.view.InflateException
Binary XML file line #51: Error inflating class com.xxx.xxx.module_base.ui.widget.ratingbar.CustomRatingBar
java.lang.reflect.Constructor.newInstance (Constructor.java)
android.view.LayoutInflater.inflate (LayoutInflater.java:414)
com.xxx.xxx.module_base.ui.widget.adapter.BaseRecyclerViewAdapter.onCreateViewHolder (BaseRecyclerViewAdapter.java:26)
com.yanzhenjie.recyclerview.AdapterWrapper.onCreateViewHolder (AdapterWrapper.java:123)
androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder (RecyclerView.java:7046)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:698)
Caused by android.content.res.Resources$NotFoundException
Resource ID #0x7f08019b
android.content.res.Resources.getValue (Resources.java:1266)
androidx.appcompat.content.res.AppCompatResources.getDrawable (AppCompatResources.java:104)
me.zhanghai.android.materialratingbar.MaterialRatingDrawable.createLayerDrawableWithTintColor (MaterialRatingDrawable.java:43)
me.zhanghai.android.materialratingbar.MaterialRatingDrawable.createLayerDrawableWithTintAttrRes (MaterialRatingDrawable.java:54)
me.zhanghai.android.materialratingbar.MaterialRatingDrawable. (MaterialRatingDrawable.java:23)
me.zhanghai.android.materialratingbar.MaterialRatingBar.init (MaterialRatingBar.java:105)
me.zhanghai.android.materialratingbar.MaterialRatingBar. (MaterialRatingBar.java:52)
com.xxx.xxx.module_base.ui.widget.ratingbar.CustomRatingBar. (CustomRatingBar.java:14)
com.xxx.xxx.module_base.ui.widget.ratingbar.CustomRatingBar. (CustomRatingBar.java:13)
com.xxx.xxx.module_base.ui.widget.ratingbar.CustomRatingBar. (CustomRatingBar.java:13)
java.lang.reflect.Constructor.newInstance (Constructor.java)
android.view.LayoutInflater.inflate (LayoutInflater.java:414)
com.xxx.xxx.module_base.ui.widget.adapter.BaseRecyclerViewAdapter.onCreateViewHolder (BaseRecyclerViewAdapter.java:26)
com.yanzhenjie.recyclerview.AdapterWrapper.onCreateViewHolder (AdapterWrapper.java:123)
androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder (RecyclerView.java:7046)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:698)
This is CustomRatingBar code:
@zhanghai
The text was updated successfully, but these errors were encountered: