Exclude class file in favor of an external library class file

Hello everybody,

I need to import classes-full-debug.jar in my project with Android Studio - Gradle. I’m able to create a dependency in the build.gradle file but I can’t let the compileDebugJava task use the classes-full-debug.jar for the compilation of my project. In classes-full-debug.jar there are special versions of Android SDKs class file. PackageManager exposes a kill method, not visible by the standard PackageManager class.

So I need to exclude the android.content.PackageManager of the standard Android SDK and use the android.content.PackageManager contained in the classes-full-debug.jar.

Is it possible in Gradle?

Thanks