Android: Clean up lint warnings and other warnings to get build success
Fixes : #6868 #12142 Worked on clearing the lint warnings (OldTargetApi, ObsoleteSdkInt, InlinedApi, NewApi)
@ejona86 @shivaspeaks Can you please review.
@Sangamesh1997 Can you provide the build error log that you are fixing with this PR? In the failing build.log of PR #12040 I don't see any errors about @TargetApi for example.
@kannanjgithub In the build log of PR #12040 , I observed that the only visible lint error was OldTargetApi. However, when I ran the lint check locally in (lint report.html), it also flagged other warnings like InlineApi, ObseleteSdkInt and NewApi, as mentioned by Eric earlier. So in this PR, I've fixed all these together to ensure build passes cleanly and is future-proof.
@Sangamesh1997 can you share that lint report.html?
@kannanjgithub lint report details.txt
Are we working on silencing? I thought the discussion happened to upgrade and fix in the #12040 (comment)
@shivaspeaks I have addressed and cleared all the lint warnings in #12143, which resolves the issue tracked in #6868. Since the team is currently working on upgrading the Android Gradle Plugin (AGP) in #10152, the target SDK upgrade to 35/36 will be taken up after that is complete. That’s why I focused on cleaning up the lint warnings first — to help unblock and resolve the 6868 issue as a separate step.
Since the team is currently working on upgrading the Android Gradle Plugin (AGP) in #10152, the target SDK upgrade to 35/36 will be taken up after that is complete.
Does it cause any problem if you set targetSdkVersion to the latest available even while the AGP is not upgraded yet? @Sangamesh1997
Since the team is currently working on upgrading the Android Gradle Plugin (AGP) in #10152, the target SDK upgrade to 35/36 will be taken up after that is complete.
Does it cause any problem if you set targetSdkVersion to the latest available even while the AGP is not upgraded yet? @Sangamesh1997
@kannanjgithub I tried and got a build failure with 'AAPT2 error: Android resourse linking failed'. SDK 35/36 introduced internal changes in resource formats. The current AGP versions cant handle these changes during resource linking. that's why I suspect that using compileSdk>34 is unsafe unless AGP is upgraded to 8.x.+.