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

fix: check for main manifest if multiple are present #2174

Merged

Conversation

WoLewicki
Copy link
Contributor

Summary:

This PR fixes a newly introduced (#1967) problem that having multiple build flavors in app causes the findManifest script to take the first found one. We think it seems more reasonable to take the one from main folder, if present. It fixes the error in Expensify app, where e2e manifest is the first found one, and the MainActivity is present in the main folder's AndroidManifest.xml. It throws such error then:

error Main activity not found in /Users/.../android/app/src/e2e/AndroidManifest.xml.

Test Plan:

Make a simple app with activity tag inside main AndroidManifest.xml and add a directory e.g. e2e with other AndroidManifest.xml, which should have the activity merged from the main. It will cause the error on gradle sync in RN 0.73.x

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

@WoLewicki
Copy link
Contributor Author

Gradle has a mechanism of merging the manifests, so if we could somehow reuse it, then it would most probably be a more general fix for weird package structures.

Copy link
Collaborator

@szymonrybczak szymonrybczak left a comment

Choose a reason for hiding this comment

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

Thank you! 🙌 Mind adding tests? 🙏

@j-piasecki
Copy link
Contributor

I've added a test case resembling a setup that's the reason for this PR. LMK if it's enough or if you want to cover other scenarios as well.

@thymikee thymikee merged commit ebde072 into react-native-community:main Nov 24, 2023
9 of 10 checks passed
@WoLewicki WoLewicki deleted the @wolewicki/fix-find-manifest branch December 8, 2023 09:33
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.

5 participants