tony-xlh / react-native-document-scanner

React Native Document Scanner using Vision Camera
17 stars 2 forks source link

Project Fails to Start - Incompatible DynamsoftDocumentNormalizer Version #2

Closed Producdevity closed 8 months ago

Producdevity commented 1 year ago

Hello maintainers,

I recently tried to start your example project following the instructions given in the README, but I ran into a problem with pod dependencies.

Here are the steps I followed:

  1. Ran npm install at the project root.
  2. Navigated into the ios directory with cd ios.
  3. Ran pod install to fetch the iOS dependencies. Unfortunately, at the third step, I encountered an error regarding incompatible versions for the DynamsoftDocumentNormalizer pod. Here is the error message I received:
Auto-linking React Native modules for target `DocumentScanner`: RNReanimated, RNSVG, RNScreens, RNShare, VisionCamera, react-native-safe-area-context, and vision-camera-dynamsoft-document-normalizer
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`
[!] CocoaPods could not find compatible versions for pod "DynamsoftDocumentNormalizer":
  In snapshot (Podfile.lock):
    DynamsoftDocumentNormalizer (= 1.0.10)

  In Podfile:
    vision-camera-dynamsoft-document-normalizer (from `../node_modules/vision-camera-dynamsoft-document-normalizer`) was resolved to 0.3.0, which depends on
      DynamsoftDocumentNormalizer (= 1.0.20)

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `DynamsoftDocumentNormalizer` inside your development pod `vision-camera-dynamsoft-document-normalizer`.
   You should run `pod update DynamsoftDocumentNormalizer` to apply changes you've made.

The error seems to suggest that DynamsoftDocumentNormalizer version 1.0.10 is required, but the vision-camera-dynamsoft-document-normalizer pod is pulling in version 1.0.20.

I attempted to resolve the issue by running pod repo update and pod update DynamsoftDocumentNormalizer as suggested, but to no avail.

I'd appreciate any guidance or potential fixes for this issue. Thank you in advance for your help!

Producdevity commented 1 year ago

I resolved the versioning issue, but then this error appeared when I tried to start the ios app:

warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'DocumentScanner' from project 'DocumentScanner')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'DocumentScanner' from project 'DocumentScanner')

2023-07-08 02:23:39.356 xcodebuild[12940:90802] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
** BUILD FAILED **

The following build commands failed:
        CompileC /Users/yassine/Library/Developer/Xcode/DerivedData/DocumentScanner-etfzltxjfudqgictesjagezynlwm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTNetwork.build/Objects-normal/x86_64/RCTNetworking.o /Users/yassine/Coding/testing/tony-xlh-react-native-document-scanner/node_modules/react-native/Libraries/Network/RCTNetworking.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-RCTNetwork' from project 'Pods')
(1 failure)
xulihang commented 1 year ago

The error is not related to the scanner plugin. Try to run it on a real device.