Override a single class from a depencency library

Hi,
I just switched from Eclipse to Android Studio and Gradle and am having problem doing one thing, that in Eclipse was trivial. This is my problem: I am using a library (libGDX) for which I modified a single class (.java) by adding some of my own methods that I use in my project. Now in Eclipse I would simply put this class to src/com/badlogic/ etc. (package path) and Eclipse would “override” original library with this single class of mine.
In Android Studio, I was unable to do this. I have 3 projects/modules (not sure how they are called here): core, desktop and android (since my app runs on both dekstop and android). I kind of managed to make it work on desktop, but not on android. It always crashes by saying it can’t find a certain method (that I added in my class but is missing in the original library’s class), like this:

java.lang.NoSuchMethodError: No virtual method backupBlendFunction()V in class Lcom/badlogic/gdx/graphics/g2d/SpriteBatch; or its super classes (declaration of ‘com.badlogic.gdx.graphics.g2d.SpriteBatch’ appears in /data/app/com.betalord.sgx-QyHr1wQsfTwgqPqpFO3SWA==/base.apk)

My question is, how can I fix this in a most elegant way?

I’m in the same situation, regrettably.

I don’t think anyone can deny that providing a modified version of a library class is a terrible design pattern, but poor decisions by a legacy developer have put us in the same situation. Is there a gradle-based solution to this?