Skip to content

Commit a9ff08a

Browse files
msluszniakclaude
andcommitted
fix: revert withReactNativeImagePickerFix to use withProjectBuildGradle
react-native-image-picker reads from rootProject.ext, so the property must be set in the root build.gradle, not app/build.gradle via project.ext. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d5a8e29 commit a9ff08a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

apps/llm/plugins/withReactNativeImagePickerFix.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const { withAppBuildGradle } = require('@expo/config-plugins');
1+
const { withProjectBuildGradle } = require('@expo/config-plugins');
22

33
/**
44
* In a Yarn workspace monorepo, react-native is hoisted to the repo root.
5-
* react-native-image-picker's build.gradle can't find it automatically,
6-
* so we set REACT_NATIVE_NODE_MODULES_DIR explicitly.
5+
* react-native-image-picker reads REACT_NATIVE_NODE_MODULES_DIR from
6+
* rootProject.ext, so it must be set in the root android/build.gradle.
77
*/
88
module.exports = function withReactNativeImagePickerFix(config) {
9-
return withAppBuildGradle(config, (mod) => {
9+
return withProjectBuildGradle(config, (mod) => {
1010
if (!mod.modResults.contents.includes('REACT_NATIVE_NODE_MODULES_DIR')) {
1111
mod.modResults.contents = mod.modResults.contents.replace(
12-
/^(android\s*\{)/m,
13-
`project.ext {
12+
/^(allprojects\s*\{)/m,
13+
`ext {
1414
REACT_NATIVE_NODE_MODULES_DIR = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parentFile.absolutePath
1515
}
1616

0 commit comments

Comments
 (0)