Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RNGP -
findPackageJsonFile
should return null
if package.json
d…
…oes not exist (#35566) Summary: `findPackageJsonFile` always returns a path even though `package.json` does not exist. This causes issues in libraries whose repo setups look like: ``` react-native-webview ├── android │ └── build.gradle ├── example <-- Note the lack of `package.json` here │ └── App.tsx ├── ios │ └── RNCWebView.xcodeproj ├── macos │ └── RNCWebView.xcodeproj ├── package.json └── src ``` When `newArchEnabled=true`, running `yarn android` will fail with the following: ``` FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:generateCodegenArtifactsFromSchema'. > Could not create task ':app:generateCodegenSchemaFromJavaScript'. > /~/react-native-webview/example/package.json (No such file or directory) ``` ## Changelog [Android] [Fixed] - `findPackageJsonFile` should return `null` if `package.json` does not exist Pull Request resolved: #35566 Test Plan: ``` git clone https://github.com/react-native-webview/react-native-webview.git cd react-native-webview git checkout new-arch-ios yarn cd example/android ./gradlew clean assembleDebug ``` Reviewed By: NickGerleman Differential Revision: D41739176 Pulled By: cortinico fbshipit-source-id: cab0f1f717db160df244c9bb2769e345d6e19917
- Loading branch information