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: race condition in android copy vs bundle phases #29128

Closed
wants to merge 1 commit into from

Conversation

glenna
Copy link
Contributor

@glenna glenna commented Jun 12, 2020

Summary

We ran into an issue where our index.android.bundle was not included in our generated .aab file (strangely, it was only happening on CI builds). I enabled --info level logging on the gradle command on our CI and noticed that > Task :app:copyPlaystoreReleaseBundledJs NO-SOURCE was there with the info that the source file didn't exist. This led me to believe that the copyXXXBundledJs task and bundleXXXJsAndAssets tasks were not executing in the proper order.

Strangely, this issue only started to occur for us after updating a dependency on Android, but I suspect it's always been a race condition and we've just gotten lucky.

This change ensures that the bundleJsAndAssets task runs before the copyBundledJs task.

I've tested locally with our code and also on our CI and both are finally working 💪

Changelog

[Android] [Fixed] - Ensure gradle task order (bundleJsAndAssets occurs before copyBundledJs)

Test Plan

./gradlew clean && ./gradlew cleanBuildCache && ./gradle bundleFlavourRelease

The generated bundle now includes index.android.bundle (of course this is difficult to test, because the issue only happens on some machines/setups/when the stars align, apparently).

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 12, 2020
@react-native-bot react-native-bot added the Platform: Android Android applications. label Jun 12, 2020
@pull-bot
Copy link

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against 834e51e

@analysis-bot
Copy link

analysis-bot commented Jun 12, 2020

Platform Engine Arch Size (bytes) Diff
ios - universal 829,440 0

Base commit: 40b36a0

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 6,762,671 0
android hermes armeabi-v7a 6,425,569 0
android hermes x86 7,149,162 0
android hermes x86_64 7,039,060 0
android jsc arm64-v8a 8,936,042 0
android jsc armeabi-v7a 8,591,363 0
android jsc x86 8,765,660 0
android jsc x86_64 9,341,193 0

Base commit: 40b36a0

@glenna
Copy link
Contributor Author

glenna commented Oct 12, 2021

This PR is no longer relevant as it's also fixed by: #32026

@glenna glenna closed this Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants