Ang*_*Koh 148 permissions warnings android-manifest android-lint android-studio
在分析Android工作室的代码(Analyze> Inspect Codes)时,我收到此lint警告.
Google搜索无法将应用程序编入索引; 考虑使用ACTION-VIEW意图填充添加至少一个活动.有关详细信息,请参阅问题说明
这是什么警告,以及如何通过Google搜索将我的应用程序编入索引?对SEO来说这听起来很重要,但我在Google上找不到任何细节.
我也想知道如何从android studio访问"问题解释".
编辑:
"谷歌搜索无法将应用程序编入索引"是旧警告.新警告"缺少对Firebase应用程序索引的支持"
Ang*_*Koh 104
我发现了如何访问"问题解释".我需要将鼠标悬停在检查错误上以显示内联的完整问题说明(并按Ctrl-F1)
所以我缺少的关键词是"深层链接"!
以下是用于执行深层链接的Android开发者页面"允许Google抓取您的应用内容并允许用户从搜索结果中输入您的应用"
http://developer.android.com/training/app-indexing/deep-linking.html
以下是有关如何进行深层链接的代码段.我不知道谷歌如何只是通过添加它来抓取我的应用程序...
<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>
Run Code Online (Sandbox Code Playgroud)
还有一个说明
Note: Intent filters may only contain a single data element for a URI pattern.
Create separate intent filters to capture additional URI patterns.
Run Code Online (Sandbox Code Playgroud)
zkv*_*arz 26
实际上,有两种方法来处理'应用程序无法通过谷歌索引'问题.
只需禁用lint警告.有时应用不会发布到Google Play,因此不需要如此深层次的链接等:
android {
defaultConfig {
// something
}
lintOptions {
disable 'GoogleAppIndexingWarning'
baseline file("lint-baseline.xml")
}
}
Run Code Online (Sandbox Code Playgroud)Bib*_*hny 18
您可以通过在<intent-filter>
里面添加以下代码来删除警告<activity>
<action android:name="android.intent.action.VIEW" />
Run Code Online (Sandbox Code Playgroud)
如果要在应用程序开发完成之前禁用此警告,或者如果没有要添加的Web URL,请在AndroidManifest.xml
文件中添加此行。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.yourappname">
<application
...
...
tools:ignore="GoogleAppIndexingWarning">
....
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
59088 次 |
最近记录: |