Skip to content

Fix: Android react.gradle VmCleanup when packaging as library#33179

Closed
nickfujita wants to merge 1 commit into
facebook:mainfrom
crunchyroll:fix-android-react-gradle
Closed

Fix: Android react.gradle VmCleanup when packaging as library#33179
nickfujita wants to merge 1 commit into
facebook:mainfrom
crunchyroll:fix-android-react-gradle

Conversation

@nickfujita
Copy link
Copy Markdown
Contributor

@nickfujita nickfujita commented Feb 25, 2022

Summary

When packaging a react app as an android library with the enableVmCleanup flag not set to false, an error occurs since the "package${targetName}" task can not be found. This PR adds a simple null check, similar to what is being done for the sTask and mTask just below it to prevent the error.

Changelog

[Android] [Fixed] - Fixes android build error when compiling as library

Test Plan

Compile project as library (com.android.library), and should not trigger and error with these changes.

Would also like to have this fix cherry-pick'd to release 0.67 after merging.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Feb 25, 2022
@react-native-bot react-native-bot added the Platform: Android Android applications. label Feb 25, 2022
@pull-bot
Copy link
Copy Markdown

Messages
📖

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

DetailsCATEGORY 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 f9304fe

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 8d50bf1
Branch: main

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,187,513 -15,683
android hermes armeabi-v7a 7,789,009 -21,241
android hermes x86 8,557,689 -17,678
android hermes x86_64 8,510,330 -15,646
android jsc arm64-v8a 9,856,467 -15,475
android jsc armeabi-v7a 8,842,518 -21,018
android jsc x86 9,822,742 -17,461
android jsc x86_64 10,419,500 -15,430

Base commit: 8d50bf1
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @nickfujita in c34ef58.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 8, 2022
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2023
…ok#33179)

Summary:
When packaging a react app as an android library with the enableVmCleanup flag not set to false, an error occurs since the "package${targetName}" task can not be found. This PR adds a simple null check, similar to what is being done for the sTask and mTask just below it to prevent the error.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fixes android build error when compiling as library

Pull Request resolved: facebook#33179

Test Plan:
Compile project as library (com.android.library), and should not trigger and error with these changes.

Would also like to have this fix cherry-pick'd to release 0.67 after merging.

Reviewed By: ShikaSD

Differential Revision: D34475934

Pulled By: cortinico

fbshipit-source-id: ce6ce43960c4b388c4b1da49a9a6e21fd3bf8e16
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. Merged This PR has been merged. Platform: Android Android applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants