2015-05-12 74 views
2

我已經產生林特文件的結果(通常稱爲lint-results.xml)和Android Studio中正確配置的Android項目運行Android的聲納皮棉報告。「LintError」發現處理(使用<code>sonar-runner</code>)

當我執行sonar-runner我得到下一個錯誤:

INFO 13:49:02.776 > 13:49:02.776 INFO - Sensor [email protected] 
INFO 13:49:02.832 > 13:49:02.832 INFO - Processing android lint report: C:\Code\Android\Project\app\lint-results.xml 
INFO 13:49:03.477 > 13:49:03.475 WARN - Unable to find rule for LintError 
[...] 
INFO 13:49:03.505 > 13:49:03.505 WARN - Unable to find file C:\Code\Android\Project\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-ads\7.3.0\AndroidManifest.xml to report issue 
[...] 
INFO 13:49:04.678 > 13:49:04.678 INFO - Sensor [email protected] (done) | time=1902ms 

有什麼可以導致這些錯誤?

回答

1

我應該深入研究lint-results.xml文件。那裏有完整的錯誤解釋。在我的情況:

<?xml version="1.0" encoding="UTF-8"?> 
<issues format="4" by="lint 24.1.2"> 

    <issue 
     id="LintError" 
     severity="Error" 
     message="No `.class` files were found in project &quot;debug&quot;, so none of the classfile based checks could be run. Does the project need to be built first?" 
     category="Lint" 
     priority="10" 
     summary="Lint Failure" explanation="This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc. 
These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed."> 
     <location file="C:\Code\Android\TestApp\app\build\intermediates\manifests\androidTest\debug"/> 
    </issue> 

因此消息告訴我該項目尚未完全建立,由於依賴問題。

解決了這個錯誤後,一切正常。

+1

這實際上是一個非常有趣的案例:android lint插件應該向您報告錯誤以避免您打開xml文件的痛苦調查。我爲此提出了一個問題:http://jira.codehaus.org/browse/SONARANDRO-36 – benzonico

+0

感謝@benzonico在您的Jira中創建問題。問題解決後有沒有辦法通知?在其他情況下,如果您可以在此處進行更新或評論,我將不勝感激。 – frapen

+1

您可以通過登錄到jira來「觀察」問題,並在更新問題時收到電子郵件。 – benzonico