很久没启动过Android项目了,准备温习一下项目,发现打开项目后清单文件报黄色警告了,App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW in...
提示disable 'GoogleAppIndexingWarning',需要禁止此警告可以在:app的bulid.gradle 文件中增加下面几行代码来关闭检索的功能
defaultConfig {
///。。。。。。。。。。。。。。。。///
}
lintOptions {
disable 'GoogleAppIndexingWarning'
baseline file("lint-baseline.xml")
}
//。。。。。。。。。。。。。。//
但是没有找到问题的根本原因,根本原因是Android提醒没有加deeplink的页面,deeplink页面是可以提供外部应用或网页直接打开指定程序的指定页面的,比如微信支付宝的支付页面,还有从抖音直接跳转到淘宝的商品详情页面,都是这个意思,这种解决办法是根据提示,添加一个deeplink页面。添加只需要找一个供外部访问的页面增加一个 action view即可,例如一下:
<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>