2

I'm trying to integrate clevertap with native react and when I include "use_frameworks!" in cocoa pods to be able to use

#import <CleverTapReact / CleverTapReactManager.h>

a compilation error is generated in UMLCore

  1. Already make the link of the application with clevertap
  2. Install all the package throught "yarn install"
  3. Install the pods throught "pod install"

This is my podfile:

//----

target 'discovery' do
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',
    'RCTAnimation',
    'RCTImage',
  ]

  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'Google-Mobile-Ads-SDK'
  pod 'CleverTap-iOS-SDK'
  pod "Segment-CleverTap"

  use_unimodules!
  use_frameworks!

  target 'discoveryTests' do
    inherit! :search_paths
  end
end

//----

I expect a good compilation for the app, and instead im getting a compilation error

this is the error code:

//----


info Undefined symbols for architecture x86_64:
  "_UMLogError", referenced from:
      +[UMUtilities NSDate:] in UMUtilities.o
      -[UMViewManager updateProp:withValue:onView:] in UMViewManager.o

info   "_UMLogInfo", referenced from:
      +[UMUtilities UIColor:] in UMUtilities.o

info   "_UMLogWarn", referenced from:
      -[UMModuleRegistry registerExportedModule:] in UMModuleRegistry.o
      -[UMModuleRegistry registerViewManager:] in UMModuleRegistry.o
      -[UMModuleRegistry registerSingletonModule:] in UMModuleRegistry.o
      -[UMModuleRegistryProvider moduleRegistryForExperienceId:] in UMModuleRegistryProvider.o
      -[UMViewManager updateProp:withValue:onView:] in UMViewManager.o
ld: symbol(s) not found for architecture x86_64

info clang: error: linker command failed with exit code 1 (use -v to see invocation)


//----
Neeku
  • 3,646
  • 8
  • 33
  • 43

2 Answers2

4

It seems like you're integrating CleverTap React Native using Cocoapods for your iOS Application and in my understanding issue is that you're unable to find the CleverTapReactManager.h class.

I would suggest adding pod 'clevertap-react-native', :path => '../node_modules/clevertap-react-native' as a dependency in your ios/Podfile instead of pod 'CleverTap-iOS-SDK'

This local clevertap-react-native Podspec integrate the React Native iOS bridge via Cocoapods.

Helping link to install the same: https://github.com/CleverTap/clevertap-react-native/blob/master/docs/install.md#installing-clevertap-react-native

Hope this helps. For further questions, you can post on https://community.clevertap.com/

  • Thanks Aditi, I tried that approach but in that scenario and without the use_frameworks! I get the error /node_modules/clevertap-react-native/ios/CleverTapReact/CleverTapReactManager.m:9:9: fatal error: 'CleverTapSDK/CleverTap.h' file not found #import – Carlos Cabezas Apr 23 '19 at 19:23
  • CleverTapSDK is a dynamic framework, by specifying **use_frameworks!** you can make CocoaPods integrate to your project via frameworks instead of static libraries. Therefore I suggest try including **use_framework!** in the pod file and then build your project. – Aditi Agrawal Apr 24 '19 at 06:03
  • Hi Aditi thanks for the answer but the thing is if we use that approach we get the error ../../../ios/Pods/Headers/Public/Firebase/Firebase.h:1:9: fatal error: 'FirebaseCore/FirebaseCore.h' file not found #import and that happens basically because we are using Firebase in order to set up google analytics and Firebase is not compatible with use_frameworks! [RNFirebase doesn't compile with use_frameworks!](https://github.com/invertase/react-native-firebase/issues/252) – Carlos Cabezas May 02 '19 at 21:28
1

or while importing in Appdelegate file , instead of

#import <<CleverTapReact/CleverTap.h>
#import <CleverTapReact/CleverTapReactManager.h>

use

#import <CleverTapReactManager.h>
#import <CleverTap.h>
josef
  • 867
  • 12
  • 28
Navaneeth
  • 11
  • 1