Closed Aiden-recovery closed 1 year ago
Hey, Unfortunately, debug builds don't work with Android yet. This is something we are aware of and should address it soon. @douglowder should have more insight on this :)
This is also stated in our docs:
https://docs.expo.dev/build-reference/e2e-tests/#using-development-builds-to-speed-up-test
oh, i missed important warning.. :( thanks your fast reply !
@mononoke-choi the specific issue we are facing is that the Detox method device.openUrl()
does not work on Android. We are trying out some different ideas for making this work, but have not yet found a reliable solution.
@douglowder / @mononoke-choi we were able to get android debug tests working. You just need to call device.LaunchApp
with the deep link URL constructed like the docs show (and then you can drop the openApp call).
Weirdly enough ios doesn't like it when you do that... and prefers separate calls. Thus our openAppForDebugBuild
looks like this:
export async function launchAppForDebugBuild(platform) {
// for debug builds ios only works if you launch the app first then open it with the deep link
// android only works if you launch it directly with the deep link
const deepLinkUrl = getDeepLinkUrl(getDevLauncherPackagerUrl(platform));
if (platform === "ios") {
await device.launchApp();
await device.openURL({
url: deepLinkUrl,
});
} else {
await device.launchApp({
url: deepLinkUrl,
});
}
}
There are two warnings thrown in android (at least for us) right after this:
WARN `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
WARN `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.
We can probably just suppress these with logbox for now though.
I got a trouble on testing this example for android in test_debug.
During the test, I followed the following steps:
1 run yarn install
to install dependences
2 run eas build -p android -e test_debug
After long waiting on the eas page, the test failed and got exactly the same error output which is posted by @Aiden-recovery
Any suggestion is welcome. @dsokal Thanks for your time and example.
Hey! Did you find any solutions for the problem? @jeremy-kunzhou I got the same problem as you, and @Aiden-recovery. The error output is the exact same.
I hope somebody can help!
i have one question. does 'detox:android:debug:test' script work correctly? i think it is hanging expo intro screen :(
when i run 'detox:android:debug:test' after 'detox:android:debug:build' it couldn't run with this error logs
thanks for your effort