appsflyer-react-native-plugin icon indicating copy to clipboard operation
appsflyer-react-native-plugin copied to clipboard

[IOS]Duplicate interface definition for class 'AppsFlyerlib'

Open viet-nguyen-1926 opened this issue 2 years ago • 13 comments

Report

I had Duplicate interface definition for class 'AppsFlyerlib' error in ios

Plugin Version

6.10.2

On what Platform are you having the issue?

IOS

What did you do?

1/Clean yan.lock,node_modules, cache ... 2/update library 6.10.2 in package json 3/ yarn install 4/Remove Podfile.lock then pod install 5/Build in Xcode

What did you expect to happen?

Can build normally

What happened instead?

Can not build Duplicate interface definition for class 'AppsFlyerlib' error in log

Please provide any other relevant information.

image

viet-nguyen-1926 avatar Apr 04 '23 09:04 viet-nguyen-1926

I'm running to the same issue. 6.9.4 works fine though.

ray-step avatar Apr 10 '23 21:04 ray-step

Tried to clean derived data? or remove the plugin, clean the pods and install it again

amit-kremer93 avatar Apr 23 '23 13:04 amit-kremer93

@amit-kremer93 Yes, I always delete it every time I build I have removed plugin then install again then check again but still have bug there

rm -rf ~/Library/Developer/Xcode/iOS DeviceSupport
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer/CoreSimulator/Caches
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -fr ios/Pods
rm -fr ios/Podfile.lock
cd ios && pod repo remove trunk&&pod install --repo-update

viet-nguyen-1926 avatar Apr 26 '23 09:04 viet-nguyen-1926

@viet-nguyen-1926 did you manage to solve it?

amit-kremer93 avatar May 31 '23 06:05 amit-kremer93

@amit-kremer93 Not yet, Now im using 6.9.4 to avoid that issue for releasing. Not only my app, my friends also have the same.

viet-nguyen-1926 avatar Jun 01 '23 03:06 viet-nguyen-1926

Which RN version and xcode do you use?

amit-kremer93 avatar Jun 21 '23 08:06 amit-kremer93

Try to open Xcode and go to Pods->Development Pods->react-native-appsflyer. Then open the file RNAppsFlyer.h and replace the import statements:

#if __has_include(<AppsFlyerLib/AppsFlyerLib.h>) // from Pod
#import <AppsFlyerLib/AppsFlyerLib.h>
#else
#import "AppsFlyerLib.h"
#endif

just with: #import <AppsFlyerLib/AppsFlyerLib.h>

amit-kremer93 avatar Jun 22 '23 07:06 amit-kremer93

@amit-kremer93 I have checked in RN 0.71.6 and Xcode 14.3 I have followed your instructions but the error is still there. I tried another way, I just changed the import path in AppDelegate from #import "AppsFlyerLib.h" to #import <AppsFlyerLib/AppsFlyerLib.h> so i can build normally without any errors

image

What do you think about this way?

viet-nguyen-1926 avatar Jul 19 '23 02:07 viet-nguyen-1926

@amit-kremer93 I tried the recommended change and it did not help. I also tried 6.10.3 which seemingly has this change and that one throws the same error.

My RN is 0.71.8, and my Xcode is 14.2.

ray-step avatar Jul 22 '23 23:07 ray-step

@viet-nguyen-1926 Do you import AppsFlyerLib.h and RNAppsFlyer in your AppDelegate.m?

amit-kremer93 avatar Jul 30 '23 07:07 amit-kremer93

@amit-kremer93 No, i dont. just only import AppsFlyerLib.h in AppDelegate.h

viet-nguyen-1926 avatar Aug 04 '23 02:08 viet-nguyen-1926

This is still an issue. I attempted the above solutions with no luck. I also tried a solution in this issue thread where we set the No Common Blocks setting to NO which also didn't work. After digging deeper into the build error I found that a previous definition is linked, which is an identical AppsFlyerLib header file, located in a folder called headers. If I try deleting this folder, it gets recreated on build. My knowledge of Xcode and the pod environment stops me here unfortunately, but hopefully this helps reach a solution.

Any help here would be greatly appreciated.

jdbarrera avatar Mar 28 '24 21:03 jdbarrera

This is still an issue. I attempted the above solutions with no luck. I also tried a solution in this issue thread where we set the No Common Blocks setting to NO which also didn't work. After digging deeper into the build error I found that a previous definition is linked, which is an identical AppsFlyerLib header file, located in a folder called headers. If I try deleting this folder, it gets recreated on build. My knowledge of Xcode and the pod environment stops me here unfortunately, but hopefully this helps reach a solution.

Any help here would be greatly appreciated.

Also, here's some version info: react-native: 0.71.14 react-native-appsflyer: 6.13.1 Xcode: 15.3 iPhone 15, iOS: 17.2

jdbarrera avatar Mar 29 '24 16:03 jdbarrera

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Jul 29 '25 10:07 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 12 '25 10:08 github-actions[bot]