求助App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW

 

After the AS upgrade, it is found that the original code will generate a report: App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW warning.

From official documentation :

To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest. These intent filters allow deep linking to the content in any of your activities. For example, the user might click on a deep link to view a page within a shopping app that describes a product offering that the user is searching for.

The solution is two:

1, according to the above tips, add a deeplink, add the following code in activity:

<activity
    android:name="com.example.android.GizmosActivity"
    android:label="@string/title_gizmos" >
    <intent-filter android:label="@string/filter_title_viewgizmos">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
        <data android:scheme="http"
              android:host="www.example.com"
              android:pathPrefix="/gizmos" />
        <!-- note that the leading "/" is required for pathPrefix-->
        <!-- Accepts URIs that begin with "example://gizmos”
        <data android:scheme="example"
              android:host="gizmos" />
        -->
    </intent-filter>
</activity>

The second method is to add the following lines of code in the bulid.gradle file of the app to turn off the retrieval function.

defaultConfig {
///////////。。。。。。。。。。。。。。。。///////
}
lintOptions {
    disable 'GoogleAppIndexingWarning'
    baseline file("lint-baseline.xml")
}
//////。。。。。。。。。。。。。。//////
}

 https://stackoverflow.com/questions/34173545/missing-support-for-firebase-app-indexing-android-lint

Published 10 original articles · Like 11 · Visits 20,000+

Guess you like

Origin blog.csdn.net/u013323018/article/details/82835241