I created a react native library using the cmd npx create-react-native-library@0.42.1 my-config
After implementing the code for library, I am able to run the example with library and execute my native code in Android.
However, when I integrate the library to my actual app and run react-native run-android, it shows the below error log
add_subdirectory given source
"/Users/.../node_modules/my-config/android/build/generated/source/codegen/jni/"
which is not an existing directory.
I checked and saw that
node_modules/my-config/android/build/generated/source (yes, there is no codegen/jni).
node_modules/my-config/android/generated/jni (the jni folder is here)
Please take a look at the below image for more information
For more information, if I copy the jni folder to the actual path. I am able to build and use the lib as normal.
Please take a look at the below image for more information
Below are some files which may give you more information about the library's config.
build.gradle (my-config library)
sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += [
"generated/java",
"generated/jni"
]
}
}
}
Description
I created a react native library using the cmd
npx create-react-native-library@0.42.1 my-config
After implementing the code for library, I am able to run the example with library and execute my native code in Android.
However, when I integrate the library to my actual app and run
react-native run-android
, it shows the below error logI checked and saw that
node_modules/my-config/android/build/generated/source
(yes, there is nocodegen/jni
).node_modules/my-config/android/generated/jni
(thejni
folder is here) Please take a look at the below image for more informationFor more information, if I copy the
jni
folder to the actual path. I am able to build and use the lib as normal. Please take a look at the below image for more informationBelow are some files which may give you more information about the library's config.
build.gradle (my-config library)
react-native.config.js (my-config library)
autolinking.json (from my actual project)
Please let me know if you need any information or have any question.
Many thanks!
Packages
Selected options
Link to repro
sorry this is a private source
Environment