Alex Charles
Alex Charles

Reputation: 371

How to resolve Android get-app-links Returns State 1024?

I can't get deep links to work on Android 13, I've followed every tutorial out there and can't get the app to simply start after entering the website.

I used the command in the android studio terminal:

adb shell pm get-app-links com.where44444.cleanbook

and it returns

  com.where44444.cleanbook:
    ID: 0892ecd5-a93b-4064-bb2c-5d6cae6e7ac6
    Signatures: [9D:F7:97:FE:92:94:1A:67:96:80:D4:07:84:F8:42:8E:96:50:2B:C2:2D:CC:19:AD:0F:CC:F1:A4:E0:72:39:BE]
    Domain verification state:
      cleanassistant.net: 1024
      www.cleanassistant.net: 1024

The documentation says

Error code of 1024 or greater

Custom error code that's specific to the device's verifier.

Double-check that you have established a network connection, and invoke the domain verification process again.

I am indeed connected to the internet both on laptop and phone.

Any help would be appreciated.

Upvotes: 27

Views: 10514

Answers (6)

jc12
jc12

Reputation: 1829

To test locally you can also Long press app icon > App info > Open by default > Add link > Check the box > Add

Upvotes: 1

user1757982
user1757982

Reputation: 11

If none of the suggestions work for you, and you have your phone or emulator connected to a proxy or VPN, The automatic verification won't work, resulting in a 1024 verification code.

You need to reinstall the app whilst not in the proxy or VPN so that the automatic verification is generated again OR you can run this command in Android Studio Terminal:

adb shell pm verify-app-links --re-verify [your app package name]

This fix the problem for me!

Upvotes: 0

santeko
santeko

Reputation: 520

The solution that worked for me was replacing my SHA256 fingerprint in my assetlinks.json with the Signature that's returned from

adb shell pm get-app-links com.package.name

Most of the documentation suggests using the fingerprint that's returned from your signing key:

keytool -list -v -keystore release-key.keystore -alias <alias> -storepass <password> -keypass <password>

But that didn't work for me because Google Play now seems to be signing my app even though when I generate the .aab in Android Studio, the local key is used. The inner workings of that I don't fully understand but I was getting the 1024 error for weeks.

Steps:

  1. Run adb shell pm get-app-links com.package.name
  2. That will return something like:
ID: a07e3734-cdbd-4389-946c-b9ebda8c3892
    Signatures: [00: .... the actual fingerprint ..... 00]
    Domain verification state:
      app.revillager.com: 1024
  1. Take that signature and paste that into your assetlinks.json:
{
 ...
 "sha256_cert_fingerprints": [
        "00: .... the actual fingerprint ..... 00"
      ]
 ...
}
  1. Push that file to your hosting service.
  2. Run the re-verify command, checking the status after 10 seconds (may have to do this multiple times):
adb shell pm verify-app-links --re-verify com.package.name
adb shell pm get-app-links com.package.name
  1. Once you see Domain verification state: com.package.name: verified, test this is working by using:
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://deeplinksite.com"

And that should launch the app on your device instead of in chrome.

Upvotes: 19

fabienbranchel
fabienbranchel

Reputation: 544

Helpful links to understand the all thing and debug these issues :

Also, you can monitor this in Google Play Console, in the Deep links menu. You can get some hints there.

In my case, the issue was geofencing enable to Europe for my domain, making it impossible for Google to verify links (because they seems to do it from USA), so I needed to disable it.

Upvotes: 2

SkaveRat
SkaveRat

Reputation: 2282

In our case we had indeed a missing signature in the assetlinks.json.

BUT, the file was agressively cached. Which caused the app not to re-verify once we fixed it.

After we stopped setting a cache header for the file and a force re-verify via

adb shell pm verify-app-links --re-verify com.example

We could indeed get it to work.

Upvotes: 4

Brian
Brian

Reputation: 381

I think the issue is you need to include that signature into your assetlinks.json. I see your file here:

https://cleanassistant.net/.well-known/assetlinks.json

It does not have the signature in your output: 9D:F7:97:FE:92:94:1A:67:96:80:D4:07:84:F8:42:8E:96:50:2B:C2:2D:CC:19:AD:0F:CC:F1:A4:E0:72:39:BE

Are doing a local build that is not signed by the Google Play store? We had the same problem, and the issue was that our assetlinks.json only included the Google Play certificate fingerprint, not the certificate fingerprint used when creating local builds (whether .aab or .apk). Once we added the local fingerprint to assetlinks.json, the app link successfully verified. Without that, we kept getting the 1024 error.

Your assetlinks.json is otherwise valid, as you can verify here:

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://cleanassistant.net&relation=delegate_permission/common.handle_all_urls

Upvotes: 26

Related Questions