Status Update
Comments
ku...@gmail.com <ku...@gmail.com> #2
This happens on AGP Version 3.6.3. Still have to test if this behavior exists on AGP 4.0 as well
ku...@gmail.com <ku...@gmail.com> #3
Was able to also reproduce this with AGP 4.0.0. You can reproduce this issue by adding the following method call to your codebase without any permissions in your manifest:
TelephonyManager telephonyManager = // ...;
telephonyManager.getNetworkType();
If you install the R preview SDK, a MissingPermission
lint error will be raised (this seems to be a new permission requirement). If you uninstall that SDK, the error will disappear.
to...@gmail.com <to...@gmail.com> #4
And I think that this fact should be mentioned in the documentation.
to...@gmail.com <to...@gmail.com> #5
cp...@twitter.com <cp...@twitter.com> #6
To be clear, the relevant bug here is not in the specific Lint report – the report itself is likely ok. The issue is that the outcome of the build on a specific machine depends on whether the Android R preview is installed or not. This caused our master to break for people installing the preview.
In my view, Lint should use the compilation SDK to select the target to use, instead of selecting the latest target that happens to be available in the machine.
tn...@google.com <tn...@google.com>
tn...@google.com <tn...@google.com> #7
Agreed. Lint was already doing this (using the SDK pointed to by compileSdkVersion) for the API lookup database, but not for the SDK annotations. This should be fixed by Change-Id: I837f3d6bcbee52b458619ad5fde4a2e2b2bd3bb7 in 4.2, and I'll also cherrypick it back to 4.1.
cp...@twitter.com <cp...@twitter.com> #9
Ohh thanks for the quick fix :))
Description
Hello,
My team is hitting a flaky issue when running lint. It turns out lint will use the highest available installed Android SDK version for looking up the
annotations.zip
resource.So if someone has android R preview installed, and someone else doesn't, their lint results are different for the same project. In most places lint is smart enough to use the compileSdkVersion that is set on the mainProject. That is except for
annotations.zip
andapi-versions.xml
.Pulled from LintClient.kt:
But this really should use the target version of the mainProject rather than the highest installed version for consistent and reproducible results.