Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - openURL is broken #925

Closed
stevechun opened this issue Sep 6, 2018 · 6 comments
Closed

Android - openURL is broken #925

stevechun opened this issue Sep 6, 2018 · 6 comments

Comments

@stevechun
Copy link

Android - openURL is broken

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 9.0.1
  • React Native: 0.55.3
  • Node: 9.3.0
  • Java: 1.8.0_172
  • Device: Android Emulator
  • Xcode: 9.4.1
  • macOS: 10.13.6 High Sierra

Description

When device.openUrl is used to open the app with deeplink, there are 2 issues.

  1. Error triggered with device.openUrl is used after device.launch due to openUrl not being triggered correctly (The deeplink is not triggered and test fails).

  2. When using device.openUrl to open the app with deeplink, the following error gets triggered even the deeplink is opened properly. This is a known issue on

Error: Could not launch intent Intent { act=android.intent.action.VIEW dat=scheme://deeplink/url flg=0x10000000 cmp=com.package.app/.MainActivity } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1523458140008 and now the last time the queue went idle was: 1523458185572. If these numbers are the same your activity might be hogging the event queue.

Analysis

For the issue 1, device.sendToHome() is required to be called before calling device.openUrl to make it work. We can probably make this to be a mandatory action for the openUrl func?

For the issue 2, looks like it is an issue related to the espresso library dependency. The workaround in the old issue fixes the problem.

I can create a PR if this is something that we want to have as a workaround in place.

@noomorph
Copy link
Collaborator

@stevechun, thanks for your thorough investigation. I think it makes sense.
Could you elaborate on espresso library dependency part, what did you mean?

@stevechun
Copy link
Author

@noomorph It was related to the update on the espresso library as it was working fine on the old version AFAIR. But didn't get a chance to go deeper.

@stale
Copy link

stale bot commented Nov 4, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.

@stale stale bot added the 🏚 stale label Nov 4, 2018
@stale
Copy link

stale bot commented Nov 11, 2018

The issue has been closed for inactivity.

@stale stale bot closed this as completed Nov 11, 2018
@noomorph noomorph reopened this Nov 12, 2018
@stale stale bot removed the 🏚 stale label Nov 12, 2018
@robertofrontado
Copy link

robertofrontado commented Nov 21, 2018

Sadly this is still an issue

@stevechun did you manage a workaround?

Edited: This worked for me

@avanderberg
Copy link
Contributor

I can use openURL successfully since https://github.com/wix/Detox/releases/tag/14.9.0

@d4vidi d4vidi closed this as completed Jan 22, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants