-
-
Notifications
You must be signed in to change notification settings - Fork 984
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
Execution failed for task ':react-native-gesture-handler:buildCodegenCLI' + Building with Monorepo #2299
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
This seems to be more of a problem with the codegen itself. The code snippet you've highlighted is kind of problematic, but it would fail only in cases where In case you're using a custom setup, you are able to set the paths to relevant packages in your react {
reactNativeDir = rootProject.file("../../../node_modules/react-native/")
codegenDir = rootProject.file("../../../node_modules/react-native-codegen/")
} The problem with that is the fact that React Gradle Plugin is also used by the libraries on the new architecture in order to trigger codegen. Because of this, the custom paths are only applied to the root project instead of all projects using the plugin. If all your packages are on the same level, you could use something like this: project.pluginManager.withPlugin("com.facebook.react") {
react {
reactNativeDir = rootProject.file("../../../node_modules/react-native/")
codegenDir = rootProject.file("../../../node_modules/react-native-codegen/")
}
} to set the same paths for all projects using the plugin. Otherwise you may need to take a more granular approach and set the paths per package depending on whether it's being hoisted or not. |
@j-piasecki Thanks for the tip.
The react block you reference is defined in the android template. However, whenever I try to use this block in my app, I get the errors noted above. Also, I'm using the new architecture, which requires some modifications to the build.gradle file which does not exist in the template above. |
@only1chi The template you've linked to is already updated for React Native 0.71.0-rc.0, and it seems like the |
@j-piasecki Thanks again for your response and notes. I had substituted A couple of things to note:
See below android/build.gradle
android/app/build.gradle
settings.gradle
|
If the problem is still related to codegen, then you might try adding the If it's not related to codegen, could you paste the gradle log? |
@j-piasecki I did some more digging... Also it is clear that the application is failing to generate the schema for Results in I managed to drill down to the Here is a code excerpt from
Per the code above, the build should skip the
Unfortunately, I am not successful. Here's the error:
|
One thing I've noticed, is the fact that you've set different paths in the
Based on the paths you've described, I think the ones in the |
@j-piasecki
I can confirm that the correct codegen directory is setup. However, I'm still encountering similar problems which I think has to do with the codegen directory. The file |
That's what I meant by
You've configured the paths for the You should be able to set the same path for every subproject by adding project.pluginManager.withPlugin("com.facebook.react") {
react {
reactNativeDir = rootProject.file("../../../node_modules/react-native/")
codegenDir = rootProject.file("../../../node_modules/react-native-codegen/")
}
} in the |
@j-piasecki |
No problem, great to see that you were able to solve the problem. I'll close the issue since you've resolved the problems with codegen. |
FAILURE: Build failed with an exception.
|
Description
I can't seem to build react-native-gesture-handler with my monorepo setup. I get the following error:
Looking at my workspace, all the packages are in the node-modules on the root folder. However, codegen CLI is looking for the scripts in the workspace node_modules folder instead of the root node_modules. See image below:
Steps to reproduce
Snack or a link to a repository
Private Repo
Gesture Handler version
2.7.1
React Native version
0.70.4
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: