I recently decided to port my Android Studio project over from ant to gradle. This project was actually created with gradle at first, but at the time I wasn't up for figuring out all the differences between gradle and ant, so I manually stripped everything gradle from the project and compiled it with ant up until now.
I decided to go back to gradle, but instead of converting the existing project, I instead just created a fresh new gradle project and imported all the modules/pasted all of the code/libs in from the old ant one.
I was able to get everything to work, except when I compile I get the following error:
I never got this method when compiling with ant, and like I said above, the code, modules, and libs are the same. When I first made this question, I actually made a mistake and entered in all of the jars in my libs folder twice. Here is the original list of dependencies:
If you look closely the first line is dir=libs include=[*.jar]. I also added all of those jars below as well (I was dumb and just didn't see that was a line). So now my dependencies list looks like this:
This is a lot less, and I figured it would solve the problem. However when I tried loading the app onto my device, the same error occurred.
One thing I thought could be the case is that many of my modules rely on the same android-support-v4 library that the main app is dependent on. I think I reference that maven repo 3-4 times in the different modules (and the main app itself). Is there a more efficient way of doing this, or does the compiler know to not include a different instance of that v4 support library for each dependency?
Another noteworthy discovery: I'm getting a handful of errors which look like this:
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.amazonaws.javax.xml.stream.xerces.util.SecuritySupport12$4) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
When I run gradlew assembleDebug (this specifically is the process which throws the error). I searched around and it seems like this is just a warning which can be ignored, but I imagine the dozen or so of these I get could have an impact. The full log can be seen here: http://pastebin.com/m4ASGQfC
Summary: I am getting the Dex 65536 error, which indicates that the project has too many method, but I only get this error since upgrading from ant to gradle, before I did that everything worked fine.
Thanks!