Comments (8)
This is (sadly) a known bug. The issue is happening regardless of you using includesGeneratedCode
or not.
I have an internal ticket to work on this.
Sadly fixing it would be a breaking change for every codegen user so we're being a bit caution on when we should fix.
from react-native.
This is definitely a bug. I'll take a look
from react-native.
@dmytrorykun opened issue #45112
from react-native.
We've been hitting this issue in react-native-builder-bob. I've added a script to patch this behavior there. You can find the script here
For folks who want to use this, when we land this in bob, you will be able to call it with --target codegen
and it should generate the codegen specs and patch this.
from react-native.
@cortinico thanks much.
Another issue is that outputDir
is not relative to package root, but to cwd. So in the reproducer if run:
cd ReproducerApp
npx react-native codegen --path ../RTNCalculator --platform android
it generates into ./android/codegen
which is ReproducerApp/android/codegen
instead of ../RTNCalculator/android/codegen
.
RTNCalculator/package.json
:
"includesGeneratedCode": true,
"outputDir": {
"android": "android/codegen"
}
Is this a bug? Shall I open a separate issue for it?
from react-native.
it generates into
./android/codegen
which isReproducerApp/android/codegen
instead of../RTNCalculator/android/codegen
.
mmm I'm not sure this follows to your previous statement.
If as you said, the path is relative to cwd (being ./ReproducerApp
in your example), then stuff should be generated inside:
./RTNCalculator/android/codegen
no?
from react-native.
mmm I'm not sure this follows to your previous statement. If as you said, the path is relative to cwd (being
./ReproducerApp
in your example), then stuff should be generated inside:./RTNCalculator/android/codegen
no?
Sorry if I wasn't clear. I'd expect
"includesGeneratedCode": true,
"outputDir": {
"android": "android/codegen"
}
to always generate into RTNCaclulator/android/codegen
so always into the lib, but if I run from the app directory it creates new folder in the app
cd ReproducerApp
npx react-native codegen --path ../RTNCalculator --platform android
it generates into ReproducerApp/android/codegen
ReproducerApp % ls -la android/codegen/java/com/rtncalculator
total 8
drwxr-xr-x 3 boga staff 96 Jun 20 14:24 .
drwxr-xr-x 4 boga staff 128 Jun 20 14:24 ..
-rw-r--r-- 1 boga staff 1130 Jun 20 14:24 NativeRTNCalculatorSpec.java
from react-native.
@dmytrorykun can help you more here as he implemented the react-native codegen
command. But yes this is probably a separate bug which needs a separate issue
from react-native.
Related Issues (20)
- TextInput menu is not hidden even contextMenuHidden is true on Android HOT 2
- onEndReached does not trigger even though onEndReachedThreshold is set HOT 2
- [iOS] Hash Generated Using Broken Cryptography API (SHA1) HOT 3
- Failed to generate podfile.lock HOT 4
- RN Alert button sometimes renders in the upper-left corner of the screen (iOS)
- [0.76.0 (nightly)] `react-native` command fails silently HOT 1
- Accessibility in android- With talkback elements are not clickable while on a screen from stack navigator. HOT 6
- PermissionsModule$1.invoke java.lang.IllegalArgumentException - Unknown permission: android.permission.POST_NOTIFICATIONS HOT 3
- React Native app works fine on ios but Axios network request in android not working HOT 6
- Modal is getting truncated when rendering at bottom on Android 15
- Dimensions.addEventListener not firing react native 0.74.3 HOT 5
- Inspector Tools issue when view are transformed in Fabric
- React Native Android fails with Desugaring enabled HOT 6
- The onChangeText and onChange events on a TextInput fire twice on Android HOT 6
- Android - Composer - Previous text is cut off after creating next line HOT 5
- [0.75.0-rc.5] Android crashes at app launch on New Architecture HOT 2
- Text inline Image in RTL layout, image position will be offset HOT 5
- Unhandled JS Exception: Invalid regular expression: HOT 6
- SIGSEGV Crashed: null pointer dereference HOT 6
- Sticky views have visual glitches while scrolling in ScrollView
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.