Android Studio does not compile when using deprecated API

I am having issues compiling and running my application on Android Studio.

The problem: It doesn’t like that I am using deprecated APIs. (from gradlew compileDebug --stacktrace. Full stacktrace here

  • what is the difference between sendStickyBroadcast and sendBroadcast in Android
  • Android GPS Location Speed Unreliable
  • Android WebView not loading Mixed Content
  • How do I make the colon vertical center in TextView
  • Android center view in FrameLayout doesn't work
  • How to get response body to retrofit exception?
  • Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    

    The Background:

    • I am using a PreferenceActivity which uses onPreferenceTreeClick and addPreferencesFromResource(int), both deprecated methods.
    • I am using ABS and ViewPager libraries, which both seem to also be using deprecated methods in their code.

    The Question:

    • Can the run configurations be edited to an extend where It can compile succesfully despite of the deprecated APIs?
    • What can be changed/edited/modified to allow the build to compile succesfully?

    Given that I plan on supporting pre-ICS devices and the usage of deprecated APIS shoudln’t suppose a problem.

    EDIT

    So, the compiler from command prompt indicates the build was succesful, problem is running from Android Studio directly, the build process fails:

    FAILURE: Build failed with an exception.
    

    The problem seems to be something I have no idea how to fix, the popular line is:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: 
    

    which is happening at three different places:

    Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
    Landroid/support/v4/app/ActivityCompatHoneycomb;
    Landroid/support/v4/app/LoaderManager;
    

    Here’s some more info: Full Compiler output in Android Studio

    * What went wrong:
    Execution failed for task ':LaPrensa:dexDebug'.
    > Running C:\Users\SkullKandy\AppData\Local\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed. 
    

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.