I'm trying to display a progress bar. It works on all devices I tested (about 10 devices), but it fails on a low cost device called Allwinner A88S Android 5.1.1. The android version is not the problem as other devices in 5.1.1 works.
So, it fails to find ressource called res/drawable/check_animated.xml My guess is that maybe it's related with a missing support library, but I can't find which library would provide check_animated.xml. Any clue or idea will be very appreciated. Maybe I could provide my own check_animated.xml, but can't find anywhere this file. Thank you.
Here is how the ProgressBar is described in the layout
<ProgressBar
android:id="@+id/jdp_waitbar"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:layout_centerHorizontal="true"
android:layout_width="160dp"
android:layout_height="5dp"
android:layout_alignParentTop="true"
android:layout_margin="0dip"
android:max="100"
android:visibility="invisible"
android:progressDrawable="@drawable/jdp_progress_drawable"
/>
And here is the exception :
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/check_animated.xml from drawable resource ID #0x7f0200d3
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2479)
at android.content.res.Resources.loadDrawable(Resources.java:2381)
at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
at android.widget.ProgressBar.<init>(ProgressBar.java:267)
at android.widget.ProgressBar.<init>(ProgressBar.java:253)
at android.widget.ProgressBar.<init>(ProgressBar.java:249)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at com.furetcompany.base.components.WaitingView.createView(WaitingView.java:112)
at com.furetcompany.base.components.WaitingView.<init>(WaitingView.java:45)
at com.furetcompany.base.network.CircuitDownloader.showWaitingDialog(CircuitDownloader.java:86)
at com.furetcompany.base.network.CircuitDownloader$5.run(CircuitDownloader.java:221)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
After several tests, it seems that the problem is with the theme of the activity.
replacing
<activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar">
with
<activity android:name=".MainActivity" android:theme="@android:style/Theme.AppCompat.Light.NoActionBar">
fixes the crash.