【问题标题】:Android Instant App is uploaded but can not be roll outAndroid Instant App 已上传但无法推出
【发布时间】: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


【解决方案1】:

如果您使用的是Google Play App Signing,那么您的本地密钥库包含上传密钥,它不同于应用签名密钥。

在这种情况下,使用 keytool 获得的 SHA256 指纹不是您应该包含 Digital Assets Link json 文件的指纹。

正确的 SHA256 指纹可以在 Google Play Console 中的 Release Management / App Signing / App signing certificate 下获得。

Play Console Screenshot

【讨论】:

  • 感谢这个新见解,等我有机会回到这个项目(目前正在做其他)后,我会再试一次
【解决方案2】:

您需要在深层链接中使用路径模式: 确保您使用的是实际域而不是 example.com

https://example.com/instantapp

【讨论】:

  • 是的,我确实使用了实际域名,example.com 只是为了隐藏我的真实域名。
  • 你在链接中使用 path:instantapp 吗?
  • 您是在询问我的网络链接“example.com/instantapp”吗?是的,它是在我的清单和本地设备中定义的,一切都按预期工作,但我无法单击 Playstore 中的“开始推出生产”按钮,因为该按钮因该错误而被禁用(见屏幕截图).. 如果你在问什么否则请描述更多
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-11-11
  • 1970-01-01
  • 2018-07-20
  • 2019-06-06
  • 1970-01-01
  • 2021-11-06
  • 1970-01-01
相关资源
最近更新 更多