1

Was recently doing a project and mid-way we had to lower the minimum supported SDK supported in the Android manifest. Some Android API's we use are not compatible the new lower minimum SDK. We only discovered these as run time crashes. Why wouldn't the Gradle and/or the Android IDE pick up these as warnings ? Normally, I see the warnings as I code it, but for code already written, I am not warned during compilation.

I would like to be able to re-compile my project, and get all the API warnings about the minimum supported SDK. I had done some research on Lint, and it testing with it, has not yielded any results beyond warning me about XML style incompatibilities. So, I can't seem to find it for Gradle, and Android IDE is not running through the existing code already written, and raising warnings. Is this possible ? If it is, can someone provide a solution.

angryITguy
  • 9,332
  • 8
  • 54
  • 82
  • 1
    Related: [How to enable lint error in Android Studio for message “Call requires API level 21 (current min is 16)”?](https://stackoverflow.com/q/39710692/295004) – Morrison Chang Nov 20 '18 at 00:23
  • @MorrisonChang that's helpful, but I need to tune it for noSuchMethod / unsupported method related crashes. Deprecated is ok so long as it's still supported by the min SDK. – angryITguy Nov 20 '18 at 00:55
  • Not sure if [this answer to Android API level annotation for Android libraries](https://stackoverflow.com/a/42447406/295004) is helpful. The prior link I provided has some approaches. You may want to update your question with what you've tried. – Morrison Chang Nov 20 '18 at 01:30
  • @MorrisonChang thanks. But that answer implies that I am inserting the required annotations when writing the code. My problem is that I started building the app, then a reduced min sdk was introduced, thereby making some api's invalid without any relevant annotations. The compiler is not picking it up and deprecation warnings are overkill. Looking for something very specific. – angryITguy Nov 20 '18 at 02:05

0 Answers0