0

As of Support Library 25.3.0 the SwitchCompat widget requires API 14 and higher. They say it is fixed in 25.3.1 but I am using 25.4.0 and this is not fixed.

I have tried to copy the old SwitchCompat.java file to my project but there is methods and classes that is package-private and cannot be used outside the support library.

There were some vital changes and additions in the latest support library version therefore I can't switch back to older version. What can I do to bring the SwitchCompat widget to Android 2.3.3?

  • 1
    The whole of the Android Support Library has a `minSdkVersion` of 14 starting with `26.0.0`. So, in the not-too-distant future, you need to either drop support for Android 2.x, stop using the Support Library (particularly things like `appcompat-v7`), or plan to maintain your own fork of the Library. Tactically... when you copied the class into your project, did you leave it in the `android.support.v7.widget` package? You'll need to rename it (`SwitchCompatCompat`, perhaps?), and switch to it in your layouts and stuff. But package-private things work so long as the class is in the same package. – CommonsWare Aug 12 '17 at 16:35
  • @CommonsWare Renaiming the class did the trick. Thanks. – Eric V. Swann Aug 13 '17 at 12:49
  • Actually, I am receiving extra money from the employer for the Android 2.3.3 support! – Eric V. Swann Aug 13 '17 at 12:50

0 Answers0