GoogleAppIndexingWarning提醒的两种解决办法

很久没启动过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>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值