dotnet / dotnet/maui

Deeplinking on Android causes crash

Open
#11,684 17 comments 5 reactions 0 assignees View on GitHub
area-controls-shell area-core-lifecycle platform/android s/triaged t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 10h
Merged PRs (30d)
306

Description

### Description

Creating a MAUI app with Deep Linking intents, then firing those intents causes a java crash

![image](https://user-images.githubusercontent.com/3627193/204148955-dcb632c1-0e98-4dbe-8810-d508915410c5.png)

### Steps to Reproduce

1. Create File -> New MAUI App
2. Add to the MainActivity an Intent Filter to allow deep linking / opening our Maui app from a URL
```
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataSchemes = new string[] { "http", "https" },
DataHost = "www.deeplink.com",
DataPaths = new string[] { "/player.php", "/tournaments/view.php" },
AutoVerify = true)]
```
3. Build and run the app
4. While the app is open, or isn't open, use ADB to simulate a deep link request
```.\adb shell am start -W -a android.intent.action.VIEW -d "https://www.deeplink.com/player.php?p=16927"```
5. In the Android Emulator, choose our MAUI app when presented with the bottom drawer choice about how to open the link
6. Witness a crash like the description says

### Link to public reproduction project repository

https://github.com/edgiardina/MauiBug_DeepLinkCrash

### Version with bug

7.0 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Android

### Affected platform versions

Android 13 Pixel 5

### Did you find any workaround?

_No response_

### Relevant log output

```shell
0xFFFFFFFFFFFFFFFF in Android.Runtime.JNIEnv.monodroid_debugger_unhandled_exception
0x59 in Android.Runtime.JNIEnv.PropagateUncaughtException at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:308,5
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.