android ubuntu 上的 lint 不同于 mac

android lint on ubuntu different from mac

我在 Mac 运行 lint boilerplate_android 上得到了:

Scanning 8.3.0: ..........................
Scanning 8.3.0 (Phase 2): 
Scanning debug: .
Scanning debug (Phase 2): 
Scanning 4.7.0: ...........................................................................................................................................................................
Scanning 4.7.0 (Phase 2): ............................................................
Scanning 8.3.0: .
Scanning 8.3.0 (Phase 2): 
Scanning debug: .
Scanning debug (Phase 2): 
Scanning 8.3.0: .............................................................................................................................................................................
Scanning 8.3.0 (Phase 2): ..................................................................................
Scanning 23.1.1: ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Scanning 23.1.1 (Phase 2): ...............................................................................................................................................................................................
Scanning 23.1.1: ...
Scanning 23.1.1 (Phase 2): .
Scanning 23.1.1: .
Scanning 23.1.1 (Phase 2): 
Scanning 23.1.1: ...............................
Scanning 23.1.1 (Phase 2): ......................
Scanning 8.3.0: .
Scanning 8.3.0 (Phase 2): 
Scanning 8.3.0: ....................................................................................................................................................................................................................................................................................................................................................
Scanning 8.3.0 (Phase 2): .............................................................................................
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1: Error: No .class files were found in project "23.1.1", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.android.support/design/23.1.1: Error: No .class files were found in project "23.1.1", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1: Error: No .class files were found in project "23.1.1", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1: Error: No .class files were found in project "23.1.1", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.7.0: Error: No .class files were found in project "4.7.0", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.3.0: Error: No .class files were found in project "8.3.0", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0: Error: No .class files were found in project "8.3.0", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0: Error: No .class files were found in project "8.3.0", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0: Error: No .class files were found in project "8.3.0", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/8.3.0: Error: No .class files were found in project "8.3.0", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/manifest/androidTest/debug: Error: No .class files were found in project "debug", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/build/intermediates/manifests/full/debug: Error: No .class files were found in project "debug", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]
app/src/main: Error: "main" is a Gradle project. To correctly analyze Gradle projects, you should run "gradlew :lint" instead. [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9" />
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/AndroidManifest.xml:20: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="7" />
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/design/23.1.1/AndroidManifest.xml:20: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="7" />
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/AndroidManifest.xml:20: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="7" />
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/AndroidManifest.xml:20: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="4" />
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_activity_chooser_view.xml:58: Error: Duplicate id @+id/image, already defined earlier in this layout [DuplicateIds]
        <ImageView android:id="@+id/image"
                   ~~~~~~~~~~~~~~~~~~~~~~~
    app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_activity_chooser_view.xml:36: @+id/image originally defined here
app/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.7.0/res/values-id: Warning: The locale folder "id" should be called "in" instead; see the java.util.Locale documentation [LocaleFolder]
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_media_action.xml:18: Error: ?android:attr/borderlessButtonStyle requires API level 11 (current min is 7) [NewApi]
    style="?android:attr/borderlessButtonStyle"
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_media_cancel_action.xml:19: Error: ?android:attr/borderlessButtonStyle requires API level 11 (current min is 7) [NewApi]
    style="?android:attr/borderlessButtonStyle"
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_template_big_media.xml:59: Error: ?android:attr/dividerHorizontal requires API level 11 (current min is 7) [NewApi]
        android:background="?android:attr/dividerHorizontal" />
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_template_big_media_narrow.xml:67: Error: ?android:attr/dividerHorizontal requires API level 11 (current min is 7) [NewApi]
        android:background="?android:attr/dividerHorizontal" />
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/manifests/full/debug/AndroidManifest.xml:41: Warning: Attribute "supportsRtl" is only used in API level 17 and higher (current min is 15) [UnusedAttribute]
        android:supportsRtl="true"
        ~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_alert_dialog_button_bar_material.xml:24: Warning: Attribute "layoutDirection" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
    android:layoutDirection="locale"
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_alert_dialog_material.xml:55: Warning: Attribute "textAlignment" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
                    android:textAlignment="viewStart" />
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_dialog_title_material.xml:36: Warning: Attribute "textAlignment" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
            android:textAlignment="viewStart"
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_search_view.xml:58: Warning: Attribute "layoutDirection" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
            android:layoutDirection="locale">
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/abc_select_dialog_material.xml:30: Warning: Attribute "overScrollMode" is only used in API level 9 and higher (current min is 7) [UnusedAttribute]
      android:overScrollMode="ifContentScrolls"
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/drawable/abc_textfield_search_material.xml:19: Warning: Attribute "state_activated" is only used in API level 11 and higher (current min is 7) [UnusedAttribute]
    <item android:state_enabled="true" android:state_activated="true" android:drawable="@drawable/abc_textfield_search_activated_mtrl_alpha"/>
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_template_big_media.xml:50: Warning: Attribute "layoutDirection" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
        android:layoutDirection="ltr"
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_template_big_media_narrow.xml:56: Warning: Attribute "layoutDirection" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
        android:layoutDirection="ltr"
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res/layout/notification_template_media.xml:39: Warning: Attribute "layoutDirection" is only used in API level 17 and higher (current min is 7) [UnusedAttribute]
        android:layoutDirection="ltr"
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml:2: Warning: Should set android:versionCode to specify the application version [MissingVersion]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
^
app/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml:2: Warning: Should set android:versionName to specify the application version [MissingVersion]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
^
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.3.0/AndroidManifest.xml:16: Warning: Should set android:versionCode to specify the application version [MissingVersion]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
^
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/AndroidManifest.xml:16: Warning: Should set android:versionCode to specify the application version [MissingVersion]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
^
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/AndroidManifest.xml:16: Warning: Should set android:versionCode to specify the application version [MissingVersion]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
^
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/AndroidManifest.xml:16: Warning: Should set android:versionCode to specify the application version [MissingVersion] ... (truncated)

但是,当我 运行 sudo /home/ubuntu/android-sdk-linux/tools/lint /var/opt/gitlab/git-data/repositories/root/00-boilerplate-android.git/00-boilerplate-android834b3e843e041787a9ac7a06aef14a766ff2ed811468056770964 后一个目录与 mac 上的 boilerplate_android 具有相同的内容时,我得到以下内容:

app/src/main: Error: "main" is a Gradle project. To correctly analyze Gradle projects, you should run "gradlew :lint" instead. [LintError]
1 errors, 0 warnings

然后我在 mac 上关注了 https://code.google.com/p/android/issues/detail?id=60416 和 运行 lint --disable LintError boilerplate_android,我得到了以下输出:

(venv)Govindas-MacBook-Pro:boilerplate_android govindadasu$ lint --disable LintError .

Scanning 23.1.1: ...............................
Scanning 23.1.1 (Phase 2): ......................
Scanning debug: .
Scanning debug (Phase 2): 
Scanning 8.3.0: .
Scanning 8.3.0 (Phase 2): 
Scanning debug: .
Scanning debug (Phase 2): 
Scanning 8.3.0: .............................................................................................................................................................................
Scanning 8.3.0 (Phase 2): ..................................................................................
Scanning 4.7.0: ...........................................................................................................................................................................
Scanning 4.7.0 (Phase 2): ............................................................
Scanning 8.3.0: .
Scanning 8.3.0 (Phase 2): 
Scanning 23.1.1: ...
Scanning 23.1.1 (Phase 2): .
Scanning 8.3.0: ..........................
Scanning 8.3.0 (Phase 2): 
Scanning 23.1.1: ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Scanning 23.1.1 (Phase 2): ...............................................................................................................................................................................................
Scanning 23.1.1: .
Scanning 23.1.1 (Phase 2): 
Scanning 8.3.0: ....................................................................................................................................................................................................................................................................................................................................................
Scanning 8.3.0 (Phase 2): .............................................................................................
app/src/main: Error: "main" is a Gradle project. To correctly analyze Gradle projects, you should run "gradlew :lint" instead. [LintError]
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9" />
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/AndroidManifest.xml:18: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
    <uses-sdk android:minSdkVersion="9"/> ... (truncated)

然而,当我 运行 sudo /home/ubuntu/android-sdk-linux/tools/lint --disable LintError /var/opt/gitlab/git-data/repositories/root/00-boilerplate-android.git/00-boilerplate-android834b3e843e041787a9ac7a06aef14a766ff2ed811468056770964 后一个目录与 mac 上的 boilerplate_android 具有相同的内容时,我得到以下内容:

No issues found.

任何想法 android lint 在 mac 和 ubuntu 之间的差异的原因是什么以及如何解决?

当您 运行 在 ubuntu 上禁用错误时,在 mac 上您没有禁用错误,即:在 Mac (venv)Govindas-MacBook-Pro:boilerplate_android govindadasu$ lint .
在 ubuntu 上:sudo /home/ubuntu/android-sdk-linux/tools/lint --disable LintError