Я настроил проект приложения для Android, чтобы обнаружить Lint ошибки и включить их в SonarQube server. Все работает нормально, но когда я явно ввести ошибку в AndroidManifest.xml
(исключив allowBackup
линии), то сонар-бегун исполнение показывает следующее предупреждение:SonarRunner: Не удалось найти предупреждение файла
16:33:57.681 WARN - Unable to find file C:\Code\Android\SampleApp\app\src\main\AndroidManifest.xml to report issue
Путь ОК, так что это не проблема. Кроме того, ошибка расположена правильно, когда я делаю gradle lint
и записывается в файл: lint-results.xml
<issue
id="AllowBackup"
severity="Warning"
message="Should explicitly set `android:allowBackup` to `true` or `false` (it's `true` by default, and that can have some security implications for the application's data)"
category="Security"
priority="3"
summary="Missing `allowBackup` attribute"
explanation="The allowBackup attribute determines if an application's data can be backed up and restored. It is documented at http://developer.android.com/reference/android/R.attr.html#allowBackup
By default, this flag is set to `true`. When this flag is set to `true`, application data can be backed up and restored by the user using `adb backup` and `adb restore`.
This may have security consequences for an application. `adb backup` allows users who have enabled USB debugging to copy application data off of the device. Once backed up, all application data can be read by the user. `adb restore` allows creation of application data from a source specified by the user. Following a restore, applications should not assume that the data, file permissions, and directory permissions were created by the application itself.
Setting `allowBackup="false"` opts an application out of both backup and restore.
To fix this warning, decide whether your application should support backup, and explicitly set `android:allowBackup=(true|false)"`"
url="http://developer.android.com/reference/android/R.attr.html#allowBackup"
urls="http://developer.android.com/reference/android/R.attr.html#allowBackup"
errorLine1=" <application
"
errorLine2=" ^"
quickfix="studio,adt">
<location
file="C:\Code\Android\SampleApp\app\src\main\AndroidManifest.xml"
line="5"
column="5"/>
</issue>
Что может быть причиной этого предупреждения, и почему ошибка не показан на сервере SonarQube?
Hi frapen, вы нашли решение для этого? Я попробовал ответить ниже на @benzonico, но все еще есть проблема. – Henry
Да, @Henry, решение, данное benzonico, работало для меня и решило мою проблему. – frapen