Skip to content

Instantly share code, notes, and snippets.

@hurali97
Created April 12, 2022 20:56
Show Gist options
  • Save hurali97/436813a0307ac1d1057ad4d52ace6e66 to your computer and use it in GitHub Desktop.
Save hurali97/436813a0307ac1d1057ad4d52ace6e66 to your computer and use it in GitHub Desktop.
apply plugin: "com.android.application"
// Add the following
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
android {
// everything else
if (isNewArchitectureEnabled()) {
// everything else
// Add the following
packagingOptions {
pickFirst '**/libhermes.so'
pickFirst '**/libjsc.so'
}
}
}
// At the bottom
if (isNewArchitectureEnabled()) {
react {
libraryName = "CustomModules" // tells about the name for your library to use when generating artifacts for ini
codegenJavaPackageName = "com.rearchdemo.custommodules" // A string that represents the Java package your code should use
root = rootProject.file("..") // path of your root project
jsRootDir = rootProject.file("../src/custom-modules/specs/") // path to your Spec folder
reactNativeDir = rootProject.file("../node_modules/react-native/") // Reference to the react-native package root
codegenDir = rootProject.file("../node_modules/react-native-codegen/") // Reference to the react-native-codegen
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment