【发布时间】:2017-06-27 05:43:34
【问题描述】:
更新:20170703 使用 Android Studio 3.0 金丝雀 5 修改了部分AndroidManifest和build.gradle文件,
Base 的 AndroidManifest 和 App 的 AndroidManifest 从内到内移动,如下所示:
<application ...>
<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />
<activity ...>
</application>
资源资产声明:
<string name="asset_statements">[{\n \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n \"target\": {\n \"namespace\": \"web\",\n \"site\": \"https://example.com\",\n }\n}]</string>
网络验证成功(见下方截图),上传新的APK和ZIP(Instant App),但还是无法推出Instant App的问题。
通过“实时聊天”联系了 google playstore 支持,承诺会在几天后回复但仍然没有回复。
------下面是旧帖子------ 我正在使用 Android Studio 3.0 Canary 4(预览版)。
Installable APK 和 Instant App (zip) 均已成功上传。
Installable APK 已经推出。
已在https://example.com/.well-known/assetlinks.json 中上传并验证了数字资产链接 json 文件
我只有1个Base模块(功能模块),在Base的AndroidManifest里面只有1个activity:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name="com.example.test.app.base.activity.MainActivity"
android:configChanges="locale|layoutDirection|orientation|keyboardHidden|screenSize"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://example.com/instantapp/.*" />
<meta-data
android:name="asset_statements"
android:resource="@string/asset_statements" />
<intent-filter android:order="1" android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="example.com" />
<data android:pathPattern="/instantapp/.*"/>
</intent-filter>
</activity>
</application>
我的 assets_statements 在 /res/string.xml 中定义:
<string name="asset_statements" translatable="false">
[{
\"include\": \"https://example.com/.well-known/assetlinks.json\"
}]
</string>
所以目前我相信一切都应该正常工作,因为在 Google Playstore 中上传时任何配置问题都会被过滤,目前我无法推出我的 Instant App,因为错误:
错误 在开始发布此版本之前解决这些错误。
您的网站“mysite.com”尚未通过数字资产链接协议链接到您的应用。请通过数字资产链接协议将您的网站链接到您的应用。
警告
在开始发布此版本之前检查这些警告。
注意:example.com 仅用于替换我的真实域。
请帮助我了解问题所在以及如何解决?
【问题讨论】:
-
我忘了说,我在“App Link Assistance”->“Associate Website”->(1)添加资产声明中忽略了Android Studio 3.0错误。 (2) 无法将字符串链接到AndroidManifest.xml (3) 无法将autoVerify 添加到intent-filter 元素(4) 成功!您的应用与所选域相关联。
-
你也可以用developers.google.com/digital-asset-links/tools/generator检查你的资产吗?还有一件事,看看这是否有帮助stackoverflow.com/a/44768067/8320998
-
被同样的错误困扰了一个多星期了。有人解决了吗?
标签: android android-instant-apps rollout