GoodDollar / ReactNativeFaceTec

React Native module that integrates FaceTec ZoOm face verification API
MIT License
7 stars 15 forks source link

FaceTecModule Is null for IOS #9

Closed Edgarb-Claims-Conf closed 2 years ago

Edgarb-Claims-Conf commented 3 years ago

Description

FaceTecModule.js file import { NativeModules } from 'react-native' const { FaceTecModule } = NativeModules export default FaceTecModule

FaceTecModule - can't extract object from Native Modules, null for IOS. But android side getting object

Gets Abort Trap 6 Error as well (screenshot attached)

Steps to reproduce

  1. Created new project
  2. npm install @gooddollar/react-native-facetec --save, cd ios && pod install
  3. running the App

Abort Trap 6 error Error

Getting Error, 'null is not an object' (evaluating '_FaceTecModule.default.getConstants')

mdcuk34 commented 3 years ago

Hey @Edgarb-Claims-Conf, we had the same problem while integrating this into our app. I believe the problem is due to the latest version of Swift and Xcode 12. However you can resolve this for now by adding the following to your Podfile:

  add_flipper_pods!('Flipper' => '0.78.0')
  post_install do |installer|
    flipper_post_install(installer)
    # react-native-facetec requires wholemodule compilation to be
    # enabled for both debug and release for the build to work.
    # Related to Swift versions and Xcode version 12.
    installer.pods_project.targets.each do |target|
      if target.name == 'react-native-facetec'
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_COMPILATION_MODE'] = 'wholemodule'
        end
      end
    end
  end
johnsmith-gooddollar commented 2 years ago

"Abort Trap" issue was fixed in this one and next two commits: https://github.com/GoodDollar/ReactNativeFaceTec/commit/0855a17c77f75f17f8c301644922acc4529e0c76