Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Links `legacy_failure` verification error on Android 12

I have setup assetlinks.json and AndroidManifest.xml so that the desired App Links are verified in all previous versions of Android. However, the verification no longer works in Android 12 (currently Beta 2). adb shell pm get-app-links <PACKAGE_NAME> returns legacy_failure.

There seems to be some changes for App Links verification in Android 12, but the documentation isn't very explicit about what needs to be changed and whether the change is backward compatible.

like image 516
Mars Lan Avatar asked Dec 23 '22 15:12

Mars Lan


1 Answers

Turns out that if you break

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

into 2 tags

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

in AndroidManifest.xml, the app link will get verified successfully on Android 12. This change also seems backward compatible on older versions of Android, even though the documentation didn't say so explicitly.

like image 58
Mars Lan Avatar answered Dec 26 '22 00:12

Mars Lan