运行 android 项目上的声纳:class 'foo.bar.R$string' 无法与其原始源文件匹配

Run sonar on android project: The class 'foo.bar.R$string' could not be matched to its original source file

当我 运行 对我的 android 项目进行声纳分析时,我总是收到很多关于 Android 资源编译生成的 .class 文件的消息,如下所示

Run sonar: The class 'foo.bar.R$string' could not be matched to its original source file. It might be a dynamically generated class.

我猜这些消息来自 Findbugs。

我试图从声纳分析中排除 **/R.class **/R$*.class,但没有成功。

关于如何删除此类消息的任何想法?

问题已解决 sonar.findbugs.excludesFilters 属性

sonarqube {
    properties {
        property 'sonar.findbugs.excludesFilters', 'findbugs-filter.xml'
    }
}

而 findbugs-filter.xml 是

<FindBugsFilter>
    <Match>
        <Or>
            <Class name="~.*\.R$.*"/>
            <Class name="~.*\.Manifest$.*"/>
        </Or>
    </Match>
</FindBugsFilter>