Skip to content

Conversation

Preeternal
Copy link

Added

  • Full support for React Native New Architecture (TurboModules).
  • Prepared builds with react-native-builder-bob.

Changed

  • Updated dependencies to React Native 0.79.2 and React 19.0.0.
  • Improved TypeScript definitions.

Fixed

  • Minor issues in Android and iOS build configurations.

@Preeternal Preeternal mentioned this pull request Aug 21, 2025
@Waffleophagus
Copy link

hey @Preeternal I figure I'd put this here since your fork doesn't have issues.

  1. THANK YOU! I was actively looking into a document scanner, found this library and was absolutely downtrodden when I discovered it didn't support the new arch.
  2. I did however run into an issue just now attempting to make a build with it. I am using expo, and expo's build service, EAS, and attempting to build a new development build on device I got the following issues:
The following build commands failed:

▸ 	CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Odomtr-eggkciekjjkzjmfkqarwrhlqmadu/Build/Intermediates.noindex/ArchiveIntermediates/Odomtr/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/DocumentScanner.build/Objects-normal/arm64/DocumentScanner-2df68a69404b3c1fecabbbabcbd24bfa.o /Users/expo/workingdir/build/node_modules/@preeternal/react-native-document-scanner-plugin/ios/DocumentScanner.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'DocumentScanner' from project 'Pods')

and the build errors out on

Build failed: The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:
- 'DocumentScanner-Swift.h' file not found
Refer to "Xcode Logs" below for additional, more detailed logs.

I'll happily dump the entirety of the xcode logs if you like, its just a lot. Also, this was an ios build (obviously) and I am on expo 53. I'll happily share anything you need to help get this working!

Thank you again for updating the package!

@Preeternal
Copy link
Author

Hey, thanks a lot for testing it out and for the kind words! 🙏
Glad to hear the fork was useful.

At the moment I’ve verified the library works 100% on a clean React Native new-arch setup (outside Expo). I haven’t yet tried it inside Expo/EAS, so there might be some quirks specific to their build service or config.

I’ll take a look at Expo/EAS integration soon — if you could indeed share the Xcode logs (at least the error section, not the full thousands of lines), that would speed things up. That way I can reproduce or patch whatever is failing on Expo side.

For now, if someone isn’t tied to Expo, the package should build and run fine with a plain RN new-arch app. But I’ll dig into Expo compatibility so you don’t have to eject.

@Preeternal
Copy link
Author

Hey, quick update 👋

I actually went ahead and tested the fork thoroughly with Expo SDK 53 (both managed workflow and bare new-arch setup). Built and ran it locally via EAS CLI (eas build --local) and also on a physical device — everything came up clean. Couldn’t reproduce the 'DocumentScanner-Swift.h' file not found issue on my side.

That said, I realize EAS Cloud sometimes behaves a bit differently from local, so I’ll try to add a defensive import for the Swift header soon, just to be safe. That tweak won’t affect plain RN builds, but should help smooth over edge-cases on Expo’s infra.

So far, with plain RN + new arch the package is 100% stable, and Expo 53 works fine for me. If you could still share the relevant section of the failing Xcode logs from your EAS build, that’d help me zero in on what’s different in your environment.

Thanks again for testing and reporting 🙏

@Waffleophagus
Copy link

There’s a decent chance it was totally on my end. I’m trying to go through Apple App Store submission right now, but will attempt to get another test going tonight. I only did the one test last time due to limited number of builds using Expo’s build service in the free tier but I may have to just pony up and pay for the service for a month to get my app over the line anyway 😅

Thank you for looking into it! And I’ll grab the logs as well and post them here just in case.

@Preeternal
Copy link
Author

@Waffleophagus
Just released v0.2.1

This update fixes the intermittent Expo EAS iOS build failures (DocumentScanner-Swift.h / VNDocumentCameraViewControllerDelegate not found) by:

  • Adding a resilient conditional import of the generated Swift header.
  • Ensuring VisionKit linkage (iOS 13+).

Please try:

  1. Bump the dependency

  2. Clear iOS artifacts locally (if testing locally):
    rm -rf ios/Pods ios/Podfile.lock ios/build
    npx pod-install

  3. For EAS Cloud builds:

    • Make sure you commit the version bump.
    • (Optional but recommended) Pin a recent CocoaPods in eas.json if you use an older default:
     {
       "cli": { "version": ">= 11.0.0" },
       "build": {
         "ios": {
           "cocoapods": "1.15.2"
         }
       }
     }
  1. Trigger a fresh EAS build (development or production).

  2. Verify the native module loads (no red screen; scan works).

If you still see the header error, please share:

  • Full failing EAS build ID
  • Expo SDK version
  • The first 30–40 lines around the compile error

Thanks for testing—feedback appreciated.

@Waffleophagus
Copy link

Hey @Preeternal thanks for your patience with me on not getting back to you. I was putting some final touches on my app that was just approved for the ios app store! (My first!!) I just got back around to looking at this and I don't know what happened the first time, but this time it worked like a charm! So thank you a ton for getting this updated. Its gonna be a key feature for my app.

You rock!

Waffleophagus

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