我有一个多模块android应用,该应用具有配置为在推送到github之前运行的lint作为预推钩子。我有2台不同的机器(均为Mac),用于为该应用程序编写代码。
在一台计算机上,由于缺少权限,棉绒会标记错误。 lint正在寻找的许可在不同的模块中声明,并且应用程序将按预期进行编译,构建和运行,因此正确执行此操作不成问题。我也是5人一组的成员,没人能看到这一点。
<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 3.6.2">
<issue
id="MissingPermission"
severity="Error"
message="Missing permissions required by TelephonyManager.getNetworkType: android.permission.READ_PHONE_STATE"
category="Correctness"
priority="9"
summary="Missing Permissions"
explanation="This check scans through your code and libraries and looks at the APIs being used, and checks this against the set of permissions required to access those APIs. If the code using those APIs is called at runtime, then the program will crash.

Furthermore, for permissions that are revocable (with targetSdkVersion 23), client code must also be prepared to handle the calls throwing an exception if the user rejects the request for permission at runtime."
errorLine1=" return when (telephonyManager.networkType) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="/Users/chris/myproject/dependencies/network/CellularInfoImpl.kt"
line="47"
column="18"/>
</issue>
我检查了以下列表,以确保两台计算机都运行相同的配置。
我的问题是,还有什么可能导致差异?我应该在哪里寻找解决方案?
谢谢。
答案 0 :(得分:0)
简单的解决方案是为缺少权限添加SuppressWarning批注。这样可以通过停止棉绒警告来克服此问题,但实际上并不能解决问题。