Closed yasicmd closed 7 months ago
@yasicmd this was reported by another developer here and we believe this is a issue with your derived data. Could you please follow the instructions from that comment and let us know if that fixes it for you. Thanks!
Hello, I am unable to reproduce this issue in a fresh clone of our SDK repo. Here are the exact steps I took, and the outcomes. Please note in particular the output from my npx react-native info
, as your Environment has discrepancies from the expected environment for the Klaviyo React Native SDK.
git clone
a new copy of this repoyarn install
in repo root directorycd example/ios
and pod install
npx react-native info
from the example/ios
directory:
System:
OS: macOS 14.1.2
CPU: (10) arm64 Apple M1 Max
Memory: 18.15 GB / 64.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.19.0
path: ~/.nvm/versions/node/v18.19.0/bin/node
Yarn:
version: 3.6.1
path: ~/.nvm/versions/node/v18.19.0/bin/yarn
npm:
version: 10.2.3
path: ~/.nvm/versions/node/v18.19.0/bin/npm
Watchman:
version: 2023.12.04.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK:
API Levels:
- "21"
- "22"
- "23"
- "24"
- "25"
- "26"
- "27"
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
- "34"
Build Tools:
- 30.0.2
- 30.0.3
- 33.0.0
- 33.0.1
- 34.0.0
System Images:
- android-21 | Google APIs ARM 64 v8a
- android-22 | ARM 64 v8a
- android-22 | Google APIs ARM 64 v8a
- android-23 | Google APIs ARM 64 v8a
- android-24 | Google APIs ARM 64 v8a
- android-25 | Google APIs ARM 64 v8a
- android-28 | Google APIs ARM 64 v8a
- android-28 | Google ARM64-V8a Play ARM 64 v8a
- android-29 | Google Play ARM 64 v8a
- android-30 | Google Play ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-32 | Google Play ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-UpsideDownCake-ext5 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.7
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Your react native version was behind
wanted: 0.73.1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Hermes was false in your env
newArchEnabled: false
Hope this helps. As Ajay referenced, cleaning your build folder and derived data would be a good first step, but I would also look closely at your environment.
Guys this still isn't fixed, It seems to be IOS only. Can you please reopen this and re address it? Ive been trying all the suggestions and my environment is as recceomnded.
@bendrobinson1998 Sorry that you are still facing this issue. Unfortunately, we are unable to reproduce this issue on our end. Just to clarify the steps you've taken - Have you tried this suggestion?
Also, the developer who opened this issue recently notified us that they are all set and hence this issue was closed. If you still believe that this is an issue with the SDK, please open a separate issue with all the details specific to your setup and we will look into it.
Okay, so I have narrowed this down. When installing the package via Yarn or NPM there seems to be multiple methods missing from the package, such as the initialise function. When I clone the example app this is not the case. Please try replicating my bug on a fresh RN project and then install the SDK via yarn or NPM
@ajaysubra still the issue is not resolved fully i have to edit the file and use the provided temporary solution every time i install the sdk. Also I tried on a different system today but the issue is on that system also. I had to edit the file in the Klaviyo sdk to fix the issue.
Finally, to fix the issue i had to write a script to replace the import statement with the fixed import statement before every build to ensure smooth run.
So it will be better if you guys can find and fix this issue since other developers also having the issue.
Thanks both for your response. @bendrobinson1998 I will try your steps to reproduce today and report back. In the meantime can you help me understand what you mean by,
multiple methods missing from the package, such as the initialise function
Since in the latest release 0.1.2
those methods are not available on the react native side.
@yasicmd can you please elaborate on what you mean by "provided temporary solution"?
Ah I see, so initialisation can only be done in the native code, not via Klaviyo.initialize? The README.md still states you can initialise via react native layer:
import { Klaviyo } from 'klaviyo-react-native-sdk';
Klaviyo.initialize('YOUR_KLAVIYO_PUBLIC_API_KEY');
Regardless, initialisiation or not I cannot get the project to build for IOS when using yarn/npm install, it is building fine for android. IOS outputs the missing swift file error.
You are right in that the latest release of the react native SDK 0.1.2
can't do initialize from the react native layer but we are in the process of making a new release 0.2.0
that allows react native developers to initialize
and setToken
from the react native code. This is why you are seeing that instructions in the readme. Once this release this to NPM soon, you'll be able to use those methods by pulling in the SDK via NPM/Yarn. I know this can be confusing, one suggestion I can make is to refer the NPM page instead of the repo readme for the exact state of the SDK since the repo will be in active development most of the times where as the NPM page will be static to a given release.
However, this is seperate from the issue you are facing with the header and we will look into it and let you know if we are able to reproduce it on our end. At the moment, our best suggestion is this.
@yasicmd can you please elaborate on what you mean by "provided temporary solution"?
https://github.com/klaviyo/klaviyo-react-native-sdk/pull/78/files
However, this is seperate from the issue you are facing with the header and we will look into it and let you know if we are able to reproduce it on our end. At the moment, our best suggestion is this.
I have attempted this but it does not fix my issue.
@yasicmd Just to be clear the PR you referenced isn't a solution we provided. The developer who opened that PR isn't a Klaviyo developer.
@bendrobinson1998 We've tried to reproduce this on our end building a new app and installing the SDK like you suggested but still we are not able to reproduce this. Here are the commands I used if it's helpful -
npx react-native@latest init AwesomeProject1
cd AwesomeProject1
npm install klaviyo-react-native-sdk
cd ios
pod install
open AwesomeProject1.xcworkspace // will open xcode for you
npm start
// run the app on xcode 15.0
Unfortunately, at this point there are no indications that this is an issue with the SDK. One thing that we did discover is that there is an issue with cocoapods version 1.15.0
so if you are on this version please consider updating. Sorry we couldn't be of much help here. Good luck!
CC: @yasicmd
My pod version: 1.15.2
And my Xcode version: 15.0.1
The other system versions are pod : 1.15.0 Xcode: 15.2
what worked for me is to replace
#import <klaviyo_react_native_sdk-Swift.h>
by
#import <klaviyo_react_native_sdk/klaviyo_react_native_sdk-Swift.h>
Description
Actual behavior
Steps to reproduce
No response
The Klaviyo React Native SDK version information
0.1.2
Environment Description