6

I have the following manifest code:

<activity
        android:name=".InterceptorActivity"
        android:launchMode="singleTask"
        android:parentActivityName=".HomeActivity"
        tools:ignore="UnusedAttribute"
        android:theme="@style/Theme.Startup"
        android:exported="true">

        <intent-filter 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="https"/>
            <data android:scheme="http"/>
            <data android:host="www.mysite.com"/>

            <data android:pathPrefix="/myPage"/>
            <data android:pathPrefix="/myFavourites"/>
       </intent-filter>
    </activity>

assetlinks.json looks ok and uploaded correctly. But all applinks still opening only in browser, and I see, that app support the link, but it's unchecked.

Also command "adb shell pm get-app-links "com.myapp.android" returns

com.myapp.android:
ID: 893......
Signatures: [13:03....DA]
Domain verification state:
  www.myapp.com: legacy_failure

Why? Please help.

Vladimir Fisher
  • 3,090
  • 2
  • 17
  • 23
  • There seems to be at least one issue about this [in the Android issuetracker](https://issuetracker.google.com/issues/204233247?pli=1) – Michael Dec 08 '21 at 14:28
  • There is also Domain verification state: www.myapp.com: legacy_failure. Could it be because of those bug too @Michael? – Vladimir Fisher Dec 08 '21 at 14:39

2 Answers2

0

I'm sure you already visit the following link: https://developer.android.com/studio/write/app-link-indexing

Just a little bit improve your manifest to clean the code

<intent-filter android:autoVerify="true" tools:node="merge">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="${hostName}" android:pathPrefix="/auth/login" android:scheme="https"/>

Check your assetlinks.json file https://DOMAIN.well-known/assetlinks.json

I faced the issue with Apple M1 Chip an link working on intel based machines, I'm made the theory Android Studio not verifying the App Link on M1 Machines

Abdul Rahman Majeed
  • 1,125
  • 2
  • 10
  • 22
0

The reason was in incorrect file syntax. The correct is:

[
  {
    "relation": [
      "delegate_permission/common.get_login_creds"
    ],
    "target": {
      "namespace": "web",
      "site": "{siteurl}"
    }
  },
  {
    "relation": [
      "delegate_permission/common.get_login_creds"
    ],
    "target": {
      "namespace": "android_app",
      "package_name": "com.my.app.android",
      "sha256_cert_fingerprints": [
        "B4:...:9M"
      ]
    }
  },
  {
    "relation": [
      "delegate_permission/common.handle_all_urls"
    ],
    "target": {
      "namespace": "android_app",
      "package_name": "com.my.app.android",
      "sha256_cert_fingerprints": [
        "B4...9M"
      ]
    }
  },
  {
    "relation": [
      "delegate_permission/common.handle_all_urls"
    ],
    "target": {
      "namespace": "android_app",
      "package_name": "com.my.app.android.dev",
      "sha256_cert_fingerprints": [
        "BK...9Q"
      ]
    }
  }
]
Vladimir Fisher
  • 3,090
  • 2
  • 17
  • 23
  • If a syntax error is not the causes, there are other suggestions to resolve the `legacy_failure` error here: https://stackoverflow.com/questions/68144323/app-links-legacy-failure-verification-error-on-android-12/70611053#70611053 – Jadent Jan 06 '22 at 17:30
  • Hi, I have only the last part in my JSON file. about dev build. and it's not working. Can you help me? – Sagar Maiyad Jan 27 '22 at 09:41
  • Sagar, you need to check every letter in your file. I my case there was "common.handle.handle_all_urls" ("handle" twice). Also check your ha256_cert_fingerprints, it should be exactly yours from Android Studio. Also you can investigate this link: https://developer.android.com/training/app-links/verify-site-associations , and this link generator and tester online: https://developers.google.com/digital-asset-links/tools/generator – Vladimir Fisher Jan 28 '22 at 10:05
  • Where was this file? What this file is called ? Can you write that as well? It does not help for the people that do not have enough context (including me) – Rohit Singh May 25 '23 at 16:12