Skip to content

Exclude generated build output from npm package#789

Merged
scarlac merged 1 commit into
teslamotors:masterfrom
avarayr:fix/exclude-generated-build-output
May 5, 2026
Merged

Exclude generated build output from npm package#789
scarlac merged 1 commit into
teslamotors:masterfrom
avarayr:fix/exclude-generated-build-output

Conversation

@avarayr
Copy link
Copy Markdown
Contributor

@avarayr avarayr commented May 5, 2026

Closes: #769

LONG VERSION

CameraKit ships a dirty android/build folder in npm.
That folder contains old generated C++ files.
When our app builds:

  1. yarn installs CameraKit.
  2. CameraKit already contains: android/build/generated/...
  3. RN 0.83 tries to generate its own files into that same folder.
  4. But Gradle sometimes skips the cleanup step because it thinks schema generation is already up-to-date.
  5. So RN writes new files on top of old files.
  6. One old .cpp remains: (NativeCameraKitSpecJSI-generated.cpp)
  7. That old .cpp expects NativeCameraKitModuleCxxSpecJSI
  8. RN 0.83’s new header no longer has that class.
  9. C++ compile fails.

SHORT VERSION

RNCK ships old generated files.
RN 0.83 generates new files with new conventions.
Old and new files get mixed.
C++ compiler explodes.

image

Copilot AI review requested due to automatic review settings May 5, 2026 20:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the library’s npm packaging rules to avoid shipping generated build artifacts (notably android/build/generated) that can conflict with the consuming app’s React Native codegen output (e.g., RN 0.83+), causing Android C++ compile failures.

Changes:

  • Add a prepack hook to delete local generated build output before packing/publishing.
  • Remove top-level build from the published files whitelist and explicitly exclude android/build from the package contents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
@scarlac scarlac merged commit 63b5788 into teslamotors:master May 5, 2026
4 of 8 checks passed
@avarayr avarayr deleted the fix/exclude-generated-build-output branch May 5, 2026 21:04
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.

Build fails on Android

3 participants