Instant Apps: “You should have at least one active

2019-04-15 18:50发布

I'm getting the error message when releasing instant-app to production.

I've read this post here: You should have at least one active APK that is mapped to site 'sample.com' via a web 'intent-filter' and this is a bit more specific.

The answer in the above link states:

Upload installable APK in alpha, beta or production with same HOST web 'intent-filter'.

I uploaded an installable apk w/ the intent-filter to alpha and that the error message went away when releasing my instant-app to pre-release, but when releasing instant-app to production I'm getting the same error.

You should have at least one active APK that is mapped to site 'sample.com' via a web 'intent-filter'.

My installable apk with the default-url intent-filter was only uploaded to alpha. However, I'm wondering if my installable apk w/ intent-filter needs to be moved to production when I try to push my instant-app to production?

3条回答
霸刀☆藐视天下
2楼-- · 2019-04-15 19:22

The reason is because the behavior needs to be the same between the same track level of the installed and instant app. The user would experience a different URL resolving behavior if the user uses the installed-app (without the proper intent-filters) after downloading the instant app.

查看更多
ら.Afraid
3楼-- · 2019-04-15 19:28

You have to add the app-link to your activity. Here's one example of what it looks like.

        <activity
        android:name=".GoodbyeActivity"
        android:label="@string/title_activity_goodbye"
        android:theme="@style/AppTheme">

        <intent-filter
            android:autoVerify="true"
            android:order="1">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="https" />
            <data android:scheme="http" />
            <data android:host="hello-flavors.instantappsample.com" />
            <data android:pathPrefix="/goodbye" />

        </intent-filter>

    </activity>

You can also use App link assistant tool to generate intent-filters. To open it Select Tools > App Links Assistant. For more details go to https://developer.android.com/studio/write/app-link-indexing.html

查看更多
放我归山
4楼-- · 2019-04-15 19:30

You need to define at least one default-url as the entry point to your app. I have defined it inside <activity> tag as below.

<activity .....>
            <meta-data
                android:name="default-url"
                android:value="https://www.example.com/home" />
</activity>
查看更多
登录 后发表回答