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

[IOS]Duplicate interface definition for class 'AppsFlyerlib' #459

Open
viet-nguyen-1926 opened this issue Apr 4, 2023 · 13 comments
Open

Comments

@viet-nguyen-1926
Copy link

viet-nguyen-1926 commented Apr 4, 2023

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 viet-nguyen-1926 changed the title Duplicate interface definition for class 'AppsFlyerlib' [IOS]Duplicate interface definition for class 'AppsFlyerlib' Apr 5, 2023
@ray-step
Copy link

ray-step commented Apr 10, 2023

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

@amit-kremer93
Copy link
Contributor

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

@viet-nguyen-1926
Copy link
Author

viet-nguyen-1926 commented Apr 26, 2023

@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

@amit-kremer93
Copy link
Contributor

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

@viet-nguyen-1926
Copy link
Author

@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.

@amit-kremer93
Copy link
Contributor

Which RN version and xcode do you use?

@amit-kremer93
Copy link
Contributor

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>

@viet-nguyen-1926
Copy link
Author

@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?

@ray-step
Copy link

ray-step commented Jul 22, 2023

@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.

@amit-kremer93
Copy link
Contributor

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

@viet-nguyen-1926
Copy link
Author

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

@jdbarrera
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants