Skip to content

fix(android): commit codegen output so source builds work + document New Arch requirement#55

Merged
craftzdog merged 2 commits into
masterfrom
fix/commit-generated-codegen
Jul 8, 2026
Merged

fix(android): commit codegen output so source builds work + document New Arch requirement#55
craftzdog merged 2 commits into
masterfrom
fix/commit-generated-codegen

Conversation

@boorad

@boorad boorad commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

Building react-native-quick-base64 from source (fresh clone / CI / monorepo consumer) fails on Android during the CMake configure step:

ReactNative-application.cmake:97 (target_link_libraries):
  Cannot specify link libraries for target "react_codegen_QuickBase64Spec"

Root cause

codegenConfig.includesGeneratedCode: true tells consuming apps not to regenerate the codegen output (the library is expected to ship it). But android/generated and ios/generated were listed in .gitignore, so a fresh clone had no generated code at all. The react_codegen_QuickBase64Spec CMake target was therefore never defined, and autolinking's target_link_libraries on it failed.

npm installs were unaffected because the published tarball already includes the generated code (produced by bob build at pack time). This only bit source builds: contributors, CI, and monorepo consumers.

Fix

  • Un-ignore and commit android/generated + ios/generated, matching the includesGeneratedCode: true contract.

Verified locally: fresh generate → Android build succeeds → example app runs and the base64 suite passes 36/36 on a New-Architecture emulator (RN 0.85).

Also: document the New Architecture requirement

While investigating, I traced the widely-reported runtime error TurboModuleRegistry.getEnforcing(...): 'QuickBase64' could not be found (e.g. margelo/react-native-quick-crypto#1052). Since 3.0.0 migrated to a pure C++ TurboModule, it only registers under the New Architecture — 3.0.0 has no Old-Architecture registration path (the legacy QuickBase64Module/Package were removed in the codegen migration). Apps on the Old Architecture (bare RN with newArchEnabled=false, or Expo SDK 53 without new arch) hit this error. This PR adds a README note covering the requirement, the fix, and the 2.2.2 fallback for Old-Architecture apps.

Commits

  • fix(android): commit codegen output so source builds work
  • docs: note New Architecture requirement for 3.0.0+

boorad added 2 commits July 7, 2026 19:53
android/generated and ios/generated were gitignored while codegenConfig
sets includesGeneratedCode: true, which tells consuming apps not to
regenerate. A fresh clone therefore had no generated code, so the CMake
target react_codegen_QuickBase64Spec was never defined and Android
builds failed with:

  ReactNative-application.cmake:97 (target_link_libraries):
    Cannot specify link libraries for target react_codegen_QuickBase64Spec

Un-ignore and commit the generated code (as includesGeneratedCode
implies) so from-source and CI builds resolve the target.
3.0.0 migrated to a pure C++ TurboModule, which only registers under the
New Architecture. Apps on the Old Architecture hit 'QuickBase64 could not
be found'. Document the requirement, the fix (enable new arch + clean
rebuild), and the 2.2.2 fallback for Old Architecture.
@craftzdog craftzdog merged commit 19d7c6d into master Jul 8, 2026
10 of 12 checks passed
@craftzdog

Copy link
Copy Markdown
Owner

Thanks!

@craftzdog craftzdog deleted the fix/commit-generated-codegen branch July 8, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants