react-native-tiktok
react-native-tiktok copied to clipboard
'TikTokOpenSDKShareRequest' has different definitions in different modules
![Screen Shot 2022-10-05 at 11 55 22](https://user-images.githubusercontent.com/65446712/193984400-deb96d3e-8368-466f-8995-82c8bc831d86.png)
Getting the same error after installed. Any fix on that?
@JackyKeng @taleduykhang Which version of RN are you using?
@Lg0gs , I'm using
RN v0.63.3
react-native-tiktok v1.1.1
@JackyKeng @taleduykhang Which version of RN are you using? I'm using "react-native": "0.67.2"
@taleduykhang
I've just tried the same version and it worked. Can you remove Podfile.lock
and Pods
folder and try again?
@Lg0gs Thanks for your feedback, I will try this way
@taleduykhang I've just tried the same version and it worked. Can you remove
Podfile.lock
andPods
folder and try again?
Thanks for suggestion. Same error and it didn't work for me.
I tried to remove Podfile.lock
and Pods
folder but still facing the same error. Any alternative solution on this?
Same error for me RN v0.67.4 react-native-tiktok v1.1.1 xCode 14.0.1
Getting the same error with a fresh project setup.
Steps:
-
npx react-native init <AppName>
-
npm install react-native-tiktok
- Build IOS, getting error
Environment: react-native: v0.70.3 react-native-tiktok: v1.1.1 TikTokOpenSDK: v5.0.15
@JackyKeng Did you run pod install
?
@Lg0gs , yes. After running pod install
will install react-native-tiktok: v1.1.1
and TikTokOpenSDK: v5.0.15
Same error for me RN v0.67.4 react-native-tiktok v1.1.1 xCode 14.0.1
Maybe error due to Xcode version 14. You try to downgrade Xcode version and try build again
@taleduykhang I was thinking about this too, I'm using XCode 13 version
@taleduykhang @Lg0gs Unfortunately on my fresh project setup above, I'm using XCode v13.4.1 :confused:
@JackyKeng What's your swift version?
@Lg0gs , my swift version
swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
@JackyKeng Can you try 5.0? Currently I'm using this version
Still looking for a fix.
I uninstalled this repo and created the same files inside my project as components -> tiktok.tsx, response.tsx, Tiktok.swift, Tiktok.m and now I don't get this issue anymore. I also added pod install TikTokOpenSDK ~> 5.0, however, now I can run expo run:ios without getting this error. The next issue I have is the other issue listed here: https://github.com/Lg0gs/react-native-tiktok/issues/12
I managed to temporarily fix this in my project. The idea is to make sure react-native-tiktok
is using the same TikTokOpenSDKShareRequest definition as my project Pods.
To do that:
- I fixed the TiktokOpenSDK version in my project to
v5.0.0
by addingpod 'TikTokOpenSDK', '5.0.0'
to my projectPodfile
. - Then I replaced
TikTokOpenSDKShareRequest
in thereact-native-tiktok
package with the one in my projectPods
folder. - To make this "fix" persist. I used patch-package to patch
[email protected]
for the project I'm working on.
Here is the diff that solved this issue in my project:
diff --git a/node_modules/react-native-tiktok/ios/Podfile.lock b/node_modules/react-native-tiktok/ios/Podfile.lock
index be8a751..09aea40 100644
--- a/node_modules/react-native-tiktok/ios/Podfile.lock
+++ b/node_modules/react-native-tiktok/ios/Podfile.lock
@@ -2,7 +2,7 @@ PODS:
- TikTokOpenSDK (5.0.0)
DEPENDENCIES:
- - TikTokOpenSDK (~> 5.0.0)
+ - TikTokOpenSDK (5.0.0)
SPEC REPOS:
trunk:
diff --git a/node_modules/react-native-tiktok/ios/Pods/TikTokOpenSDK/TikTokOpenSDK.framework/Headers/TikTokOpenSDKShare.h b/node_modules/react-native-tiktok/ios/Pods/TikTokOpenSDK/TikTokOpenSDK.framework/Headers/TikTokOpenSDKShare.h
index 2e6a412..29b802f 100644
--- a/node_modules/react-native-tiktok/ios/Pods/TikTokOpenSDK/TikTokOpenSDK.framework/Headers/TikTokOpenSDKShare.h
+++ b/node_modules/react-native-tiktok/ios/Pods/TikTokOpenSDK/TikTokOpenSDK.framework/Headers/TikTokOpenSDKShare.h
@@ -9,6 +9,8 @@
NS_ASSUME_NONNULL_BEGIN
+FOUNDATION_EXTERN NSString *const TikTokVideoKitDisableMusicSelectionKey;
+
typedef NS_ENUM(NSUInteger, TikTokOpenSDKShareMediaType) {
TikTokOpenSDKShareMediaTypeImage = 0, //!< Map to PHAssetMediaTypeImage
TikTokOpenSDKShareMediaTypeVideo, //!< Map to PHAssetMediaTypeVideo
@@ -74,10 +76,15 @@ typedef void (^TikTokOpenSDKShareCompleteBlock)(TikTokOpenSDKShareResponse *Resp
@property (nonatomic, assign) TikTokOpenSDKLandedPageType landedPageType;
/**
- To associate your video with a hashtag, set the hashtag property on the request. The length cannot exceed 35. You app needs to have access to this feature.
+ To associate your video with a hashtag, set the hashtag property on the request. The length cannot exceed 35. Your app needs to have access to this feature.
*/
@property (nonatomic, copy) NSString *hashtag;
+/**
+ Add extra share options to disable/enable users from adding music, anchors, or effects when sharing to TikTok. If the dictionary is empty, the default will enable users to do what they want.
+ */
+@property (nonatomic, strong) NSDictionary *extraShareOptions;
+
/**
The Media type of localIdentifiers in Album, All attachment localIdentifiers must be the same type
*/
Version that I am using RN v0.68.1 react-native-tiktok v1.1.1 TikTokOpenSDK v5.0.0 Xcode v13.4.1
Any real fix on that matter ? Same here for me after install 🥺
RN v0.70.5
react-native-tiktok v1.1.1
TikTokOpenSDK v5.0.14
Xcode v14
@priscaure Try to downgrade the opend sdk to the 5.0.0 version
@priscaure, the patch package and downgrade to
TikTokOpenSDK v5.0.0
is a real solution. If you wantTikTokOpenSDK v5.0.14
, create a PR. otherwise, shut the fuck up.
@jeremyspritelyco If you can't reply to people without insulting them, don't bother replying. @Lg0gs offered me a solution without being condescending (Thank you btw). You could've done the same, and in the future grow "the fuck" up.
Have a nice day !
My case.
I commented import TikTokOpenSDK
out and it worked.
node_modules/react-native-tiktok/ios/Tiktok.swift
import Foundation
// import TikTokOpenSDK
import Photos
@objc(Tiktok)
class Tiktok: UIViewController {
Hi everyone. I struggled to solve the issue for a while and was able to solve the issue clearly in the end. Working well for both 5.0.0 and 5.0.14.
How to fix?
- Go to node_modules/react-native-tiktok/ios/podfile
Change
pod 'TikTokOpenSDK', '~5.0.14'
To
pod 'TikTokOpenSDK', '5.0.0' or pod 'TikTokOpenSDK', '5.0.14'
- Delete Podfile.lock and pod install (in node_modules/react-native-tiktok/ios)
- Go to ios directory of your RN project
- Delete Podfile.lock and pod install (in ios directory of your RN project)
I believe the issue will never happen anymore.
I'm still hitting this issue, I have both set to 5.0.0. Can you help me understand why we need to add the TikTokOpenSDK as both a root Pod as well as a subfolder within the react native project? Cant we just use one?
Hi Missed one thing
Open react-native-tiktok.podscpec
file in node_modules/react-native-tiktok/
Change like this line s.dependency "TikTokOpenSDK", "5.0.0"
Hope it works fine for you.
Following @supershik's comments resolved my issue. Thanks @supershik
To persist the changes, it's better to patch using the command npx patch-package react-native-tiktok
, which will create a patch file under patches
directory.