1

Whenever I upload my base and feature APKs to Play Store I got these errors :

  • You must provide a default URL for your Instant App APKs. Learn More
  • Your site 'www.example.com' has not been linked through the Digital Assets Link protocol to your app. Please link your site through the Digital Assets Link protocol to your app.
  • You should have at least one active APK that is mapped to site 'www.example.com' via a web 'intent-filter'.

And here is my manifest file : (EDITED)

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.ex.example.feature.productdetail">

      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
      <uses-permission android:name="android.permission.INTERNET"/>
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
      <uses-permission android:name="android.permission.WAKE_LOCK"/>


      <application>

    <activity
        android:name=".activity.ProductDetail"
        android:configChanges="orientation|screenSize"
        android:screenOrientation="portrait">
      <meta-data
          android:name="default-url"
          android:value="https://www.example.com/product/12345" />

      <meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>

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

        <data android:scheme="http" android:host="www.example.com"/>
        <data android:scheme="https" android:host="www.example.com"/>
        <data android:pathPattern="/product/12345"/>
      </intent-filter>

      <intent-filter>
         <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>

    </activity>

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id"/>
  </application>
    </manifest>

I put the assetlinks.json file to my web site, and when I proceed test link file, it gives success. What am I doing wrong any idea? Thanks your help in advanced

senaaltun
  • 309
  • 2
  • 11

3 Answers3

5

This is because the default URL you specified (https://www.example.com) is not supported by the intent-filters in your Instant App (https://www.example.com/product/productId).

You will either need to update the default URL so it points to a supported URL, or add a new intent-filter that supports the default URL.

AdamK
  • 19,771
  • 5
  • 37
  • 54
  • I updated my default url to https://www.example.com/product/12345 but still got same error on Play Console :( – senaaltun Jun 19 '17 at 14:42
  • Can you look at my edited manifest file in question? Still what am I doing wrong? @AdamK – senaaltun Jun 19 '17 at 16:44
  • Try combining the tags in your intent-filter and using wildcards for pathPattern (or use pathPrefix without wildcard), eg: `` – AdamK Jun 19 '17 at 19:10
  • Hey, my published app does not include default url in my entry point. The error 2 and 3 is related to this? @AdamK – senaaltun Jun 20 '17 at 10:02
  • Yes your Instant App URLs must be a subset of your installable apps supported URLs. Therefore the default URL must be supported by intent filters in both your installable apps manifest and instant app manifest. – AdamK Jun 20 '17 at 10:05
  • Thank you very much! @AdamK – senaaltun Jun 20 '17 at 10:07
  • + Does my installable app also have to include the urls defined in my fature manifest? @AdamK – senaaltun Jun 20 '17 at 10:09
  • Rule is that any URL supported in your Instant app (in any feature) must also be supported in your installable app (but not the other way around) – AdamK Jun 20 '17 at 10:20
  • Last question :) Before I release my app with app link, is there any way to test these before production? Because my published app does not include links, I cannot test and even if upload my feature APKs, it still gives 2 and 3 errors @AdamK – senaaltun Jun 20 '17 at 12:48
  • For testing app links in general, please look through the available steps/options in the docs here: https://developer.android.com/training/app-links/index.html#testing – AdamK Jun 20 '17 at 18:44
  • "This is because the default URL you specified is not supported by the intent-filters in your Instant App", and why this is not supported??? "You will either need to update the default URL so it points to a supported URL, or add a new intent-filter that supports the default URL." add a new valid url and is this enough??? – Jorgesys Dec 20 '17 at 15:53
1

You must specify the host of your domain in the manifest, you can not use www.example.com

> <data android:scheme="http" android:host="www.yuorwebsite.com"/>
> <data android:scheme="https" android:host="www.yuorwebsite.com"/>

, also before the intent - filter in manifest, specify

<meta-data
 Android: name = "default-url"
 Android: value = "https://yourwebsite.com/main" />
KitKat
  • 31
  • 2
0

I agree with @KitKat and AdamK. Based from this documentation. To allow Google Play and Android launcher to discover your app, you must provide at least one activity as the entry point for your app. In the manifest for your app, the entry point activity must have an <intent-filter> element that includes the CATEGORY_LAUNCHER and ACTION_MAIN intents.

Your app must also define a default URL for your app. Within the same Android manifest as your entry-point activity, you define the default URL for your app by adding a <meta-data> element with a value attribute that provides a valid HTTPS URL that the activity can handle. Further, this default url must also be part of the CATEGORY_LAUNCHER activity's intent filter in the installed app.

abielita
  • 12,126
  • 2
  • 15
  • 52