-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Building from source plugin 'com.facebook.react.codegen' not found #30271
Comments
Hey @wvfan, any luck? |
there must be an additional dependency required to bring down the new gradle plugin, but I can't find any docs anywhere on how to reference it in build.gradle. |
Finally I give up using master. I just use the last release version 0.63 which does not use codegen, and it works. One more thing that I encountered but not shown on document is the hermes/DebuggerAPI.h import issue. The solution is to copy all files under node_modules/hermes-engine/android/include/hermes to node_modules/react-native/ReactCommon/hermes. I just want to change a little bit Java code to solve the overflow touch issue but it takes me 3 days :( Hope you can save some time. |
@wvfan are you facing some problem related to libs that are using |
I think it should have a type name like 'export type StackNavigator = {'. Typescript is supported by react-native well and I didn't do any config to use it. |
Fixed by updating the self builded to |
I'm seeing this as well, marking for escalation. |
I don't have a fix, but this happens because the codegen stuff assumes the system can run .sh scripts, which Windows can't. |
@fabriziobertoglio1987 FYI: this command doesn't work on Windows OOTB (the |
Looks like |
@sergeymorkovkin How do you get |
how do we get this to work then? |
finally i have a fix with this problem: 1、build plugin reac-native-codegen from 'react-native/packages/react-native-codgen' and uploadArchives to my own private maven. |
I think right now, it is better to build directly in React Native repo, rather than build in your app's repo as a dependency. Build react native, and then push the whole repo with artifacts to GitHub. Use GitHub repo's URL to install your custom react native. Here is what I have done to build patched RN (mostly just following the wiki): git clone https://github.com/facebook/react-native
cd react-native
git checkout v0.64.1 # or any other release
# now make changes to the code
# build android artifacts
docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android /bin/sh -c "./gradlew installArchives --no-daemon" Note: if the gradle daemon unexpectedly disappears, try minimize the max ram usage in the root org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 and check After the build succeeds, include build artifacts git add android --force
git commit -m 'Release for some patches'
git checkout -b release-fix-something
git remote set-url origin https://github.com/myusername/react-native
git push origin release-fix-something:master In your app's repo, install react-native by your fork: yarn add https://github.com/myusername/react-native.git |
You can check my solution here: #31176 (comment) |
Description
I followed the instruction of building from source, but when I tried to run 'react-native run-android', it shows that the plugin 'com.facebook.react.codegen' was not found.
React Native version:
master
Steps To Reproduce
Here is the detail:
Jetifier found 1089 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
Where:
Build file 'D:\Company\D-Engraver\projects\hashtag2\program\node_modules\react-native\ReactAndroid\build.gradle' line: 10
What went wrong:
Plugin [id: 'com.facebook.react.codegen'] was not found in any of the following sources:
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 13s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
The text was updated successfully, but these errors were encountered: