Android Studio lint.xml配置

时间:2016-01-20 09:42:19

标签: android xml lint

我想在Android Studio中配置lint以忽略某些文件。我已将 lint.xml 文件放在 app / 文件夹中。这是lint文件的内容:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="UnusedResources">
        <ignore path="res/drawable/background_palette_drawable_6.xml" />
    </issue>
</lint>

当我运行lint检查未使用的资源时,它仍然会将此文件视为未使用。

在app build.gradle 中我有:

lintOptions {
    disable 'InvalidPackage'
    abortOnError false
    absolutePaths false
    lintConfig file('lint.xml')
}

我尝试将文件路径更改为/app/src/main/res/drawable/background_palette_drawable_6.xml 但它仍然不起作用。

我放了<issue id="UnusedResources" severity="ignore">,在这种情况下只是忽略所有未使用的资源,所以看起来文件lint.xml被正确找到但是路径可能有问题?

1 个答案:

答案 0 :(得分:10)

考虑使用<webview> log4j:WARN File option not set for appender [file]. log4j:WARN Are you using FileAppender instead of ConsoleAppender? Starting ChromeDriver (v2.2) on port 48743 Exception in thread "main" org.openqa.selenium.WebDriverException: chrome not reachable (Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 20.97 seconds Build info: version: '2.49.0', revision: '365eeb44deba2067b1761c8862ef21d55250e063', time: '2016-01-13 11:57:39' System info: host: 'NT421', ip: '192.168.22.194', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79' Driver info: org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at org.openqa.selenium.remote.RemoteWebDriver.<init> (RemoteWebDriver.java:131) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138) at functional.webStoreDummyTest.OpenSACITest.main(OpenSACITest.java:49) glob模式匹配文件,无论其位置如何。