expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
32.6k stars 5.18k forks source link

Deep linking Expo generated AndroidManifest.xml bug #30248

Open Andrey123815 opened 2 months ago

Andrey123815 commented 2 months ago

Minimal reproducible example

https://github.com/Andrey123815/expo-bug/

What platform(s) does this occur on?

Android

Did you reproduce this issue in a development build?

Yes

Summary

Good afternoon! I hope you can review and fix this issue.

When building an android, an incorrect one is generated AndroidManifest.xml config. You can view it in the android/app/src/main folder. It is worth paying attention to the fact that there are two attributes in one intentfilter and the latter overrides all the above options. This affect only android apps deep linking.

https://github.com/Andrey123815/expo-bug/blob/main/image.png?raw=true

It would be great to split this into 2 intent-filters with different attributes. To verify my statement, you can check any expo android application and use the adb utility: adb shell am start -W -a android.intent.action.VIEW -d "https://some.domain/profile/123".

I have analyzed all possible cases. What is surprising: the application has some.domain as a verified domain, but nevertheless does not respond in any way to any some.domain links with the http/https scheme or any other.

Face with this problem in production after eas build, at check .apk eas build and at locally build android

Environment

expo-env-info 1.2.0 environment info: System: OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) Shell: 5.8.1 - /bin/zsh Binaries: Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm npmPackages: expo: ~51.0.17 => 51.0.18 react: 18.2.0 => 18.2.0 react-native: 0.74.3 => 0.74.3 Expo Workflow: bare

Expo Doctor Diagnostics

✗ npx expo-doctor@latest ✔ Check Expo config for common issues ✖ Check package.json for common issues ✔ Check native tooling versions ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check npm/ yarn versions ✔ Check for issues with metro config ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check for legacy global CLI installed locally ✔ Check that native modules do not use incompatible support packages ✔ Check that packages match versions required by installed Expo SDK ✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

The following scripts in package.json conflict with the contents of node_modules/.bin: depcheck, prettier.

One or more checks failed, indicating possible issues with the project.

madmeatballs commented 1 month ago

@Andrey123815 are you expecting your app to open from web deep link? I am not sure if our issues are similar, but it has something to do with this.

If it is, I found that we need to do some updates in the settings. Specifically allowing app links, if you navigate through your android simulator or device's Settings > Apps > Your App > Open by default you will see that Open supported links is disabled (ours was). I had to enable it and select the link from which we setup .well-known/assetlinks.json. It worked for us.

Andrey123815 commented 1 month ago

@Andrey123815 are you expecting your app to open from web deep link? I am not sure if our issues are similar, but it has something to do with this.

If it is, I found that we need to do some updates in the settings. Specifically allowing app links, if you navigate through your android simulator or device's Settings > Apps > Your App > Open by default you will see that Open supported links is disabled (ours was). I had to enable it and select the link from which we setup .well-known/assetlinks.json. It worked for us.

Unfortunately, i check this on my phone and checkbox with deep link domain is activated automatically, my case is not in this. I check android links with adb utility - app show my domain as verified. My app perfectly open by packageId://domain/somPath and dont open by https://domain/somePath