不同机器之间的绒毛差异

问题描述 投票:0回答:1

我有一个多模块的安卓应用,它在推送到github之前配置了lint运行,作为推送前的钩子。我有两台不同的机器(都是Mac)来为这个应用写代码。

在其中一台机器上,lint会因为权限缺失而出现错误。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.&#xA;&#xA;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>

我已经检查了以下列表,以确保两台机器运行的配置相同。

  • Android Studio版本。
  • 这是同一个分支上的相同代码库。
  • Gradle插件版本
  • gradle.properties
  • gradle-wrapper.properties
  • 安卓工作室偏好的纠错检查。(缺失的权限都打上了勾)
  • lint config.xml
  • lint版本,取自完成gradle任务后的lint报告。

我的问题是,还有什么原因会导致这种差异?我还应该从哪些方面尝试解决这个问题?

谢谢。

android android-studio gradle android-gradle-plugin lint
1个回答
0
投票

简单的解决方案是为Missing Permissions添加一个SuppressWarning注解。这可以通过停止lint警告来解决这个问题,但实际上并不能解决这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.