简体   繁体   English

ubuntu上的android lint与mac有所不同

[英]android lint on ubuntu different from mac

I ran lint boilerplate_android on Mac and I got: 我在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)

However, when I ran sudo /home/ubuntu/android-sdk-linux/tools/lint /var/opt/gitlab/git-data/repositories/root/00-boilerplate-android.git/00-boilerplate-android834b3e843e041787a9ac7a06aef14a766ff2ed811468056770964 where the latter directory has the same contents as boilerplate_android on my mac, then I got the following: 但是,当我运行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

So then I followed https://code.google.com/p/android/issues/detail?id=60416 and I ran lint --disable LintError boilerplate_android on mac and I got the following output: 所以然后我跟随https://code.google.com/p/android/issues/detail?id=60416 ,我在Mac上运行了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)

However, when I ran sudo /home/ubuntu/android-sdk-linux/tools/lint --disable LintError /var/opt/gitlab/git-data/repositories/root/00-boilerplate-android.git/00-boilerplate-android834b3e843e041787a9ac7a06aef14a766ff2ed811468056770964 where the latter directory has the same contents as boilerplate_android on my mac, then I got the following: 但是,当我运行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.

Any ideas what is the reason for the difference between android lint on mac vs ubuntu and how to resolve? 任何想法是Mac vs ubuntu上的android lint之间差异的原因是什么以及如何解决?

When you run on ubuntu, you have disabled the errors, on mac you did not ie: On Mac (venv)Govindas-MacBook-Pro:boilerplate_android govindadasu$ lint . 在ubuntu上运行时,您已禁用错误,在Mac上则不是:在Mac(venv)Govindas-MacBook-Pro:boilerplate_android govindadasu $ lint上。
And on ubuntu: sudo /home/ubuntu/android-sdk-linux/tools/ lint --disable LintError 在ubuntu上:sudo / home / ubuntu / android-sdk-linux / tools / lint --disable LintError

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM