user1234
user1234

Reputation: 679

Android: Gradle Error in Android Studio

I recently added some .gifs to my /drawable so that I can use them with buttons. This worked fine (no errors). Now, when I go to rebuild/run my application, I get the following error:

Error: Gradle: Execution failed for task ':MyProject:mergeDebugResources'. > Index: 0

I'm not sure how to fix this (and there appears to be no other similar issues that I could find online.

Edit: Now it's the same error, but it also says (at the end of the first error)

Running /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt failed. See output

Upvotes: 0

Views: 742

Answers (1)

user1234
user1234

Reputation: 679

Okay, I fixed the issue. It was quite weird.

A) I had some capital letters in my res/drawables folder. Not too weird -- I can see how that would remove the first error.

B) Then, however, a lot of values in my main activity file became undefined. I had to manually import 'com.myapp.R'. Now that was weird.

Fortunately, everything is now working.

I hope that if anyone gets the same errors as me, that this response can help them.

Upvotes: 1

Related Questions