From dba2966afb2b1ac19fb3d7dc9dd6548445cc119e Mon Sep 17 00:00:00 2001 From: Rohit Dobariya Date: Thu, 3 Sep 2026 12:27:03 +0530 Subject: [PATCH 1/2] fix(android): apply codegen plugin unconditionally, not gated on isNewArchitectureEnabled RN's autolinking discovers this module's codegen libraryName by regexing the raw text of android/build.gradle (findLibraryName.js) rather than evaluating this file's Groovy conditionals. So the app-level build always registers this module for codegen and expects android/build/generated/source/codegen/jni/ to exist, regardless of isNewArchitectureEnabled(). Because `apply plugin: 'com.facebook.react'` and the `react { ... }` codegen block were gated behind isNewArchitectureEnabled(), consuming apps with newArchEnabled=false never actually ran this module's own codegen task, so that directory was never created. This produces a hard CMake configure failure for any consumer: CMake Error: add_subdirectory given source ".../react-native-esc-pos-printer/android/build/generated/source/codegen/jni/" which is not an existing directory This is also unconditionally required going forward: RN 0.82+ no longer supports opting out of New Architecture (newArchEnabled is ignored), so codegen must always run regardless of that flag. Applies the plugin and configures the react{} codegen extension unconditionally, matching how other actively-maintained RN modules declare codegen. No behavior change for consumers already on New Architecture. --- android/build.gradle | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index f57c51d..9ef14cf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,9 +15,11 @@ def isNewArchitectureEnabled() { apply plugin: 'com.android.library' -if (isNewArchitectureEnabled()) { - apply plugin: 'com.facebook.react' -} +// Apply the RN codegen plugin unconditionally: RN's autolinking discovers this +// module's `libraryName` by regexing this file's text (findLibraryName.js), not by +// evaluating isNewArchitectureEnabled(), so it always expects codegen output here +// regardless of the consuming app's newArchEnabled setting. +apply plugin: 'com.facebook.react' def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['EscPosPrinter_' + name] @@ -131,10 +133,8 @@ dependencies { // From node_modules } -if (isNewArchitectureEnabled()) { - react { - jsRootDir = file("../src/") - libraryName = "EscPosPrinter" - codegenJavaPackageName = "com.reactnativeescposprinter" - } +react { + jsRootDir = file("../src/") + libraryName = "EscPosPrinter" + codegenJavaPackageName = "com.reactnativeescposprinter" } From 345ddc844cea3a437db203d6c9b68ae4dd0629a8 Mon Sep 17 00:00:00 2001 From: Rohit Dobariya Date: Thu, 3 Sep 2026 12:30:04 +0530 Subject: [PATCH 2/2] chore: bump version to 2.3.0 Minor bump rather than a patch: consuming apps now get a real behavior change (codegen artifacts are always generated, not just when newArchEnabled=true), not just a bugfix in the strict sense. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 46c0155..5323758 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oolio-group/react-native-esc-pos-printer", - "version": "2.2.4", + "version": "2.3.0", "description": "test", "main": "lib/commonjs/index", "module": "lib/module/index",