应用DeepLinking问题:点击链接时应用重复显示且一个无法正常工作
Hey there! Let's dig into this duplicate app listing issue with deep linking—it’s such a headache when you tap a link and see your app twice, especially when one doesn’t even work. Here are the most likely causes and fixes to try out:
1. 重复的Intent Filter配置
The most common culprit is multiple identical (or overlapping) <intent-filter> entries in your AndroidManifest.xml targeting the same deep link. The system treats each valid filter as a separate app entry, hence the duplicate listing.
- How to check: Open Android Studio, locate your
AndroidManifest.xml, right-click it and select Merged Manifest (this shows the final combined config, including entries added by third-party libraries). Search for your deep link's scheme (e.g.,android:scheme="myapp") to count how many<intent-filter>blocks include this setup. - Fix: Delete redundant filters, leaving only the one pointing to your correct deep link-handling Activity. If a third-party library added the duplicate, use
tools:node="remove"to strip it out:
<!-- Add this to your Manifest to remove the duplicate filter from third-party code --> <intent-filter tools:node="remove"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="myapp" /> <!-- Replace with your actual scheme --> </intent-filter>
2. Linked to a deprecated/non-functional Activity
If one duplicate entry points to an abandoned or improperly configured Activity, that’s why one option works and the other doesn’t.
- How to check: In the Merged Manifest, look at which Activity each duplicate filter is tied to. Confirm which Activity is your current, valid deep link handler.
- Fix: Remove the filter linked to the deprecated Activity. Also ensure your target Activity has code to process the deep link intent:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) intent?.data?.let { uri -> // Handle deep link logic here (e.g., navigate to the correct screen) } }
3. App Links verification failure (if using autoVerify)
If you enabled android:autoVerify="true" for App Links but the verification failed (e.g., incorrect assetlinks.json deployment), the system may show both an App Links entry and a regular deep link entry—creating the appearance of duplicates.
- How to check: Verify that your domain hosts a valid
assetlinks.jsonfile with matching package name and signature fingerprint for your app. - Fix: Either fix the
assetlinks.jsonto pass verification, or removeandroid:autoVerify="true"temporarily to switch back to regular deep linking mode.
4. Stale system cache
Sometimes the system caches old app intent configurations, even after you’ve updated your Manifest.
- Fix: Fully uninstall the app and reinstall it, or go to system settings → Apps → Your App → Clear default opening preferences, then test the link again.
内容的提问来源于stack exchange,提问作者user2951

