Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined is not an object, ejected expo app. #64

Closed
llanginger opened this issue Jul 20, 2018 · 2 comments
Closed

Undefined is not an object, ejected expo app. #64

llanginger opened this issue Jul 20, 2018 · 2 comments
Assignees

Comments

@llanginger
Copy link

Hi guys,

I'm facing this same issue described in parts of #34 (with an ejected expo app). I have tried this with both a fairly complex app built with expo and newly-ejected as well as a completely fresh expo app. Same error in either case.

Steps to reproduce:

1: create-react-native-app [name] and cd into [name]
2: yarn eject, choosing expokit
3: yarn add blinkid-react-native and react-native link blinkid-react-native
4: update Podfile (Could there be some issue here?) as such;

platform :ios, '9.0'

EXPO_CPP_HEADER_DIR = 'ExpoKit'

target 'blinkid' do
  pod 'PPBlinkID', '~> 4.0.0'
  pod 'ExpoKit',
    :git => "http://github.com/expo/expo.git",
    :tag => "ios/2.5.10",
    :subspecs => [
      "Core",
      "CPP",
      "GL"
    ]

  pod 'React',
    :path => "../node_modules/react-native",
    :subspecs => [
      "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "CxxBridge"
    ]
  pod 'yoga',
    :path => "../node_modules/react-native/ReactCommon/yoga"
  pod 'DoubleConversion',
    :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
    :inhibit_warnings => true
  pod 'Folly',
    :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
    :inhibit_warnings => true
  pod 'glog',
    :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
    :inhibit_warnings => true


  post_install do |installer|
    installer.pods_project.main_group.tab_width = '2';
    installer.pods_project.main_group.indent_width = '2';

    installer.pod_targets.each do |target|

    if target.pod_name == 'ExpoKit'
      target.native_target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'
        
        # needed for GoogleMaps 2.x
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Maps/Frameworks'
      end
    end


    if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? target.pod_name
      target.native_target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
    # Build React Native with RCT_DEV enabled
    next unless target.pod_name == 'React'
    target.native_target.build_configurations.each do |config|
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
    end

    end
  end
end

5: pod install (so far no errors)
6: copy example app to App.js, replacing license key with my generated key

Result of pressing "Scan":

undefined is not an object (evaluating 'BlinkIDNative.scanWithCamera')
- node_modules/blinkid-react-native/index.js:27:60 in scanWithCamera$
- node_modules/regenerator-runtime/runtime.js:62:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:296:30 in invoke
- node_modules/regenerator-runtime/runtime.js:62:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:152:28 in invoke
- node_modules/regenerator-runtime/runtime.js:195:17 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:194:27 in callInvokeWithMethodAndArg
- node_modules/regenerator-runtime/runtime.js:217:12 in enqueue
- node_modules/regenerator-runtime/runtime.js:241:8 in async
* App.js:69:16 in scan$
- node_modules/regenerator-runtime/runtime.js:62:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:296:30 in invoke
- node_modules/regenerator-runtime/runtime.js:62:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:152:28 in invoke
- node_modules/regenerator-runtime/runtime.js:195:17 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:194:27 in callInvokeWithMethodAndArg
- node_modules/regenerator-runtime/runtime.js:217:12 in enqueue
- node_modules/regenerator-runtime/runtime.js:241:8 in async
* null:null in scan
- node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js:201:45 in touchableHandlePress
- node_modules/react-native/Libraries/Components/Touchable/Touchable.js:744:34 in _performSideEffectsForTransition
- ... 21 more stack frames from framework internals

Any help would be greatly appreciated - in an ideal world I would like to be able to include this in my product demos coming up next week, though it's the weekend so that's not where I'm setting my expectations!

Thanks in advance,

-Leo

@DoDoENT DoDoENT assigned ghost and juraskrlec Jul 23, 2018
@jcular jcular assigned jcular and unassigned juraskrlec and ghost Sep 20, 2018
@jcular
Copy link
Contributor

jcular commented Sep 28, 2018

Hi @llanginger,

I created an app using expo and ejected it(expokit) and it runs as expected. I have used v4.2.0 of BlinkID but there should be no difference in the usage. Since you used cocoapods, see if you have git-lfs installed. Git-lfs might be the cause especially if this happens only on iOS. If you don't have git-lfs follow the instructions here.

Kind regards,
Jure

@mparadina
Copy link
Contributor

Hi @llanginger,

We’re closing this issue as it is inactive, but please let us know if this is still an open issue for you.

Also, you can always contact us directly at support@microblink.com

Best,
Milan

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

No branches or pull requests

4 participants