Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build error for Android projects that use `apply plugin: "com.and…
…roid.library"` (#22312) Summary: This PR allows Android projects that use `apply plugin: "com.android.library"` to build successfully. A recent regression caused by #20526 means that building one of these projects always fails with this error: ``` FAILURE: Build failed with an exception. * Where: Script '/Users/james/src/SampleLibrary/node_modules/react-native/react.gradle' line: 15 * What went wrong: A problem occurred configuring project ':app'. > Could not get unknown property 'applicationVariants' for object of type com.android.build.gradle.LibraryExtension. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 0s ``` This change updates `react.gradle` to cater to both application and library projects by selectively using `android.applicationVariants` or `android.libraryVariants`. Fixes #22310. Pull Request resolved: #22312 Differential Revision: D13373742 Pulled By: cpojer fbshipit-source-id: 64c35ab7a6d5d0d840a43729123e70dd8e0d36e0
- Loading branch information