Skip to content

android(feat):new arch support #4675

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

Merged
merged 42 commits into from
Jan 16, 2025
Merged

android(feat):new arch support #4675

merged 42 commits into from
Jan 16, 2025

Conversation

gosha212
Copy link
Contributor

Description

In this pull request, I have added support for the new arch in detox


For features/enhancements:

  • I have added/updated the relevant references in the documentation files.

For API changes:

  • I have made the necessary changes in the types index file.

# Conflicts:
#	detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/animations/AnimatedModuleIdlingResource.kt
@gosha212 gosha212 changed the title Feat/4175 new arch android(feat):new arch support Dec 24, 2024
@asafkorem
Copy link
Contributor

asafkorem commented Jan 13, 2025

@gosha212 I think the test app will crash on the Localization screen on Android, since it uses a legacy native module.
If we're not testing that due to unsupported features it might be better to disable this screen on Android

@gosha212 gosha212 marked this pull request as ready for review January 13, 2025 09:39
@asafkorem
Copy link
Contributor

we should check if our bridge native modules work with backward comp. or if there's something magically /hybrid that happens here

Copy link
Contributor

@asafkorem asafkorem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In iOS we can check the env flag process.env.RCT_NEW_ARCH_ENABLED
We can use this when running new arch on android as well (for the tests)

Copy link
Collaborator

@d4vidi d4vidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, great job. Lot's of notes on my end but we are nevertheless very close to finish 👑

Comment on lines 150 to 155
api('androidx.test:core-ktx:1.6.1') {
because 'Needed by Detox but also makes AndroidX test core seamlessly provided to Detox users with hybrid apps/E2E-tests.'
}
api("org.jetbrains.kotlin:kotlin-reflect:$_kotlinVersion") {
because('Needed by Detox for kotlin reflection')
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on 2nd thought, maybe implementation would be a better idea here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Google Chrome 2025-01-16 14 42 50

@gosha212 gosha212 merged commit 0e77622 into master Jan 16, 2025
2 of 3 checks passed
@gosha212 gosha212 deleted the feat/4175-new-arch branch January 16, 2025 13:59
@mikehardy
Copy link
Contributor

Hey @gosha212 - just wanted to say thanks for the new arch fixes in detox - I know it's a pain getting the ReactContext because I also had to fight my way through it in react-native-firebase and notifee, with all the symbols being different across versions but you need it to work on all the versions too, what a pain.

I tried the 20.33.0-prerelease.0 release and it works for me (at least with one trivial build.gradle patch that's already tracked here in an issue). 20.32.0 definitely didn't get the react context in new arch mode, but I've got all the correct adb logcat messages now indicating it has it with these PRs in the prerelease 🔥

@gosha212
Copy link
Contributor Author

gosha212 commented Feb 5, 2025

@mikehardy thanks for the warm words. The iOS is 99% ready

@mikehardy
Copy link
Contributor

react-native-firebase e2e app (my use case here) does almost no app interaction so we are not a great indicator of full-feature functionality, but it's working for us on react-native iOS platform as well as react-native-macos already, for basic app launch / terminate / ready-signaling behavior, so I'm well-pleased. Merged the PR with it already and our e2e app is able to test (and sadly, uncover some) new architecture issues

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 9, 2025

@mikehardy thanks again for the kind words! 🙏🏻
On iOS, we've been finalizing some edge cases related to Detox's handling of app crash scenarios.

...able to test (and sadly, uncover some) new architecture issues

Music to our ears... 🎶 whenever tests uncover issues, we feel better about our work 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants