My project built with no errors, but when I try to run my app on my phone or on the emulator I get the error: "Failed to complete Gradle execution. Cause: ".
I looked at this answer: Android Studio: failed to complete gradle execution, cause is empty. I tried to do a clean but that didn't work. I tried to change the GradleVM setting, but that didn't work either. I then read in one of the answers that there may be an error in one of the resource files. I have found an error in a resource file:
1.
<?xml version="1.0" encoding="utf-8"?>
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false"
>
<item
android:drawable="@drawable/loading_01"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_02"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_03"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_04"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_05"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_06"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_07"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_08"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_09"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_10"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_11"
android:duration="100"
/>
<item
android:drawable="@drawable/loading_12"
android:duration="100"
/>
</animation-list>
The error I get here is "Element animation-list doesn't have required attribute android:layout_height and layout_width". I followed the example given in the documentation (https://developer.android.com/guide/topics/graphics/drawable-animation.html) but it still gives me this error. I didn't think that animation-lists needed a height and width.... am I wrong? Any help would be great! Thank you.
UPDATE:
Here is where it is used in code:
if (isPrintJob)
{
image_printJobThumb.setImageResource(R.layout.animation_loading);
....
}
else
{
image_cutJobThumb.setImageResource(R.layout.animation_loading);
}