grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

Android: Clean up lint warnings and other warnings to get build success

Open Sangamesh1997 opened this issue 9 months ago • 6 comments

Fixes : #6868 #12142 Worked on clearing the lint warnings (OldTargetApi, ObsoleteSdkInt, InlinedApi, NewApi)

Sangamesh1997 avatar Jun 10 '25 09:06 Sangamesh1997

@ejona86 @shivaspeaks Can you please review.

Sangamesh1997 avatar Jun 19 '25 05:06 Sangamesh1997

@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 avatar Jun 19 '25 06:06 kannanjgithub

@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 avatar Jun 19 '25 08:06 Sangamesh1997

@Sangamesh1997 can you share that lint report.html?

kannanjgithub avatar Jun 19 '25 09:06 kannanjgithub

@kannanjgithub lint report details.txt lint

Sangamesh1997 avatar Jun 19 '25 09:06 Sangamesh1997

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.

Sangamesh1997 avatar Jun 20 '25 06:06 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 avatar Jul 10 '25 10:07 kannanjgithub

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.+.

Sangamesh1997 avatar Jul 11 '25 04:07 Sangamesh1997