Does anyone of you guys know this exception in Gradle build?
Error:Execution failed for task ':app:mergeDebugResources'.
> java.lang.ArrayIndexOutOfBoundsException (no error message)
My project worked fine, until I implemented a Video player in a new activity that parses a MP4 file from the SD-Card. Then I got this exception. After that I updated Android Studio, I cleaned the project, I relocated it, I rebuilt it. This all didn´t solve the problem.
Then I uncommented path calls for the case that this error happens because the generated build file path exceeds the windows max path length of 255 characters. This also didn´t work.
I would be thankful for any hint!
I just changed my libraries to latest version and problem solved. for me it was 25.1.1 and i changed them to 25.2.0
compile 'com.android.support:appcompat-v7:[latest-version]'
compile 'com.android.support:design:[latest-version]'
compile 'com.android.support:support-v4:[latest-version]'
compile 'com.android.support:cardview-v7:[latest-version]'
compile 'com.android.support:recyclerview-v7:[latest-version]'
Hope helps someone ;)
Updating the Android Studio doesn't update the gradle version. You have to manually do it. In your project level build.gradle file, replace the gradle dependency with this version:
classpath 'com.android.tools.build:gradle:2.1.2'
If you guys now feeling tired after applying everything please do one thing
create a new project and shift all your code to that new project(if possible) but keep one thing in mind that start with classes and layout files and after every step run your code to check and which icons you need from drawables copy that into your project and run after every small step.
All in all i want to say you personally i have wasted so much time in this problem and this solution looks complex but this will take few hours but give 100% solution of your problem.
Why we follow this long process?
many times what happened that we keep on writing the code and studio keep on accepting everything but at any day any random time(when R file regenerat) studio does not accept some of the things but you never came to know where you miss something that's why in some cases this approach might be look easy instead applying hit and try.