AppsFlyerSDK / AppsFlyerFramework

AppsFlyer Apple SDK
https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS
Other
166 stars 89 forks source link

Can't compile AppsFlyerFramework(5.4.0, .xcframework, CocoaPods) #115

Closed 0xacdc closed 4 years ago

0xacdc commented 4 years ago

Report

Undefined symbols for architecture x86_64: "OBJC_CLASS$_AppsFlyerTracker", referenced from:

SDK Version

5.4.0

What did you do?

Run pod update AppsFlyerFramework became 5.4.0

andr-ggn commented 4 years ago

Try clean project and remove DerivedData

0xacdc commented 4 years ago

ld: warning: ignoring file Pods/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-armv7_arm64/AppsFlyerLib.framework/AppsFlyerLib,

missing required architecture x86_64 in file Pods/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-armv7_arm64/AppsFlyerLib.framework/AppsFlyerLib (2 slices)

Undefined symbols for architecture x86_64:

it may be an issue related to cocoapods integration of xcframeworks

andr-ggn commented 4 years ago

For my help to be more effective, provide a more extensive log. Also I need this: VALID_ARCHS, SUPPORTED_PLATFORMS, ONLY_ACTIVE_ARCH And can you reproduce an error on an empty project?

amitbattan commented 4 years ago

I am also facing same issue. After update to version 5.4.0, we are not able to compile the code in debug mode. However build is successfully achieve on CI/CD pipeline.

Error getting while build is 'AppsFlyerLib/AppsFlyerTracker.h' file not found

Build was successfully compile and executed with AppsFlyerFramework 5.3.0

andr-ggn commented 4 years ago

@amitbattan I think this is related to .xcframework. In 5.4.0 we started to use .xcframework instead of .framework. Xcode version, VALID_ARCHS, SUPPORTED_PLATFORMS, ONLY_ACTIVE_ARCH CocoaPods version OS X version

amitbattan commented 4 years ago

@andr-ggn

Xcode version - 11.4.1 (11E503a) VALID_ARCHS - arm64 arm64e armv7 armv7s SUPPORTED_PLATFORMS - iOS ONLY_ACTIVE_ARCH - Yes CocoaPods version - 1.8.4 OS X version - 10.15.4

andr-ggn commented 4 years ago

Update your CocoaPods version to 1.9.0 or higher. 1.8.4 does not support xcframework

amitbattan commented 4 years ago

thanks @andr-ggn it works for me after update CocoaPods version

0xacdc commented 4 years ago

@andr-ggn my setup is : Xcode version - 11.5 VALID_ARCHS - arm64 arm64e armv7 armv7s SUPPORTED_PLATFORMS -iOS ONLY_ACTIVE_ARCH - Yes CocoaPods version -1.9.3 OS X version - 10.15.5

and it's still not working

andr-ggn commented 4 years ago

@0xacdc Can you create an empty project and integrate AppsFlyer there? I have to know if it is related to versions(CocoaPods, OSX, Xcode) or you have specific configuration of your project. I would appreciate it!

0xacdc commented 4 years ago

@andr-ggn it works on an empty project, seems like it's a problem related to my project. But I can confirm that your .xcframework doesn't work only with cocoapods, if I drag the .xcframework directly into the project, all is working fine

andr-ggn commented 4 years ago

@0xacdc Can you provide your Podfile?

andr-ggn commented 4 years ago

Also can you try clean cache for CocoaPods? pod cache clean 'AppsFlyerFramework' and rm -rf "${HOME}/Library/Caches/CocoaPods" rm -rf "{project_path}/Pods/" pod update

0xacdc commented 4 years ago

Unfortunately I can't show you the Podfile, because our project is private and most of our pod dependencies are private too.

On the other hand: pod cache clean 'AppsFlyerFramework' rm -rf "${HOME}/Library/Caches/CocoaPods" rm -rf "{project_path}/Pods/" pod update

didn’t help

af-fess commented 4 years ago

Unfortunately I can't show you the Podfile, because our project is private and most of our pod dependencies are private too.

On the other hand: pod cache clean 'AppsFlyerFramework' rm -rf "${HOME}/Library/Caches/CocoaPods" rm -rf "{project_path}/Pods/" pod update

didn’t help

@andr-ggn maybe worth to switch to email because of sensitive info

navartis commented 4 years ago

It seems to me that the reason is that the library are distributing as binary and 5.4.0 version was compiled using Xcode 11.4.1.

Apple resolve issue about armv7 in the Xcode 11.5 (11E608c)

Apple Clang Compiler Resolved Issues Fixed an issue with incorrect code generation when targeting armv7 devices. (61901594)

https://developer.apple.com/documentation/xcode_release_notes/xcode_11_5_release_notes

May be maintainers of the library should just rebuild framework using Xcode 11.5 (11E608c)

andr-ggn commented 4 years ago

So why it works if you import library without CocoaPods? I think the problem in CocoaPods

navartis commented 4 years ago

I was just update dependencies and CocoaPods it self from 1.9.1 up to 1.9.4 in project.

And as a result roll back app flyer from 5.4.0 back to 5.2.0

It seems to me CocoaPods is not a reason

andr-ggn commented 4 years ago

@andr-ggn it works on an empty project, seems like it's a problem related to my project. But I can confirm that your .xcframework doesn't work only with cocoapods, if I drag the .xcframework directly into the project, all is working fine

@navartis 👆

navartis commented 4 years ago

@andr-ggn In my case rolling back AppsFlyerFramework pod from 5.4.0 back to 5.2.0 helps

andr-ggn commented 4 years ago

I found this: https://github.com/CocoaPods/CocoaPods/issues/9794 https://github.com/CocoaPods/CocoaPods/issues/9785

@navartis Can I ask you downgrade CocoaPods from your version to 1.9.1 and try 5.4.0 again?

5.2.0 uses .framework and 5.4.0 .xcframework

0xacdc commented 4 years ago

@andr-ggn
pod : 1.9.1 AppsFlyerFramework: 5.4.0

same issue Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_AppsFlyerTracker"

andr-ggn commented 4 years ago

@0xacdc Check please Pods-Project.debug.xcconfig Is it contains this: FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-armv7_arm64" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-i386_x86_64-simulator" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-x86_64-maccatalyst"

All 4 paths 👆

0xacdc commented 4 years ago

@andr-ggn FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-armv7_arm64" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-i386_x86_64-simulator" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-x86_64-maccatalyst"

it's absolutely the same

andr-ggn commented 4 years ago

@0xacdc Framework Search Paths in your Build Settings

"${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-armv7_arm64" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-i386_x86_64-simulator" "${PODS_ROOT}/AppsFlyerFramework/Mac Catalyst/AppsFlyerLib.xcframework/ios-x86_64-maccatalyst"

?

andr-ggn commented 4 years ago

Please, add

0xacdc commented 4 years ago

here it is :

Screenshot 2020-06-04 at 19 51 42

it looks like it takes the first platform it founds

andr-ggn commented 4 years ago

Works?

0xacdc commented 4 years ago

not in the least, same result Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_AppsFlyerTracker"

andr-ggn commented 4 years ago
0xacdc commented 4 years ago

here it is :

Screenshot 2020-06-04 at 19 51 42

it looks like it takes the first platform it founds

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AppsFlyerTracker", referenced from:

0xacdc commented 4 years ago

The arch's on each platform are ok, therefore, the only explanation that I have is that the cocoapods somehow integrate the xcframerwork incorrectly in my case

remizorrr commented 4 years ago

XCFrameworks doesn't work yet.

On cocoapods master xcframeworks works for simulator and device, but not for archive. (https://github.com/CocoaPods/CocoaPods/issues/9794) On cocoapods stable version xcframeworks only works for device.

danwey commented 4 years ago

same too.

andr-ggn commented 4 years ago

Is someone tried totally remove CocoaPods from project and integrate it again?

hachinobu commented 4 years ago

I'm experiencing the same error in the same environment.

The solution is to go to the target "Frameworks and Libraries" and We can add the AppsFlyerFramework.xcframework.

but, I feel like this method is a workaround.

スクリーンショット_2020-06-11_午後6_00_34

0xacdc commented 4 years ago

Is someone tried totally remove CocoaPods from project and integrate it again?

pod deintegrate this does not change anything

andr-ggn commented 4 years ago

Small recap: 1 - The problem is not in the framework, but in CocoaPods 2 - The repository has all versions of the framework and you can manually add version 3 - If the problem will persist with CocoaPods - the next release will be with .framework, and .xcframework we will move to a separate Pod

0xacdc commented 4 years ago

Small recap: 1 - The problem is not in the framework, but in CocoaPods 2 - The repository has all versions of the framework and you can manually add version 3 - If the problem will persist with CocoaPods - the next release will be with .framework, and .xcframework we will move to a separate Pod

Given the current circumstances, I think the 3 is the most optimal solution

brizzly commented 4 years ago

Same issue for me, we are waiting for new SDK release that rollback the framework issue.

mirovodin commented 4 years ago

I think I have a similar problem. I have problem with build my project on CI:

error: Multiple commands produce '/Users/jenkins/Library/Developer/Xcode/DerivedData/xxx/Build/Products/Debug-iphonesimulator/cocoapods-artifacts-Debug.txt':

Testing failed:
Multiple commands produce '/Users/jenkins/Library/Developer/Xcode/DerivedData/xxx/Build/Products/Debug-iphonesimulator/cocoapods-artifacts-Debug.txt':

1) That command depends on command in Target 'xxxApp' (project 'xxxApp'): script phase “[CP] Prepare Artifacts”
2) That command depends on command in Target 'xxxUITests' (project 'xxxApp'): script phase “[CP] Prepare Artifacts”
LuxBuild commented 4 years ago

Do we know when this issue gonna fix? when to expect new version? Also what is the work around this? manually add 5.4.0 to project or use earlier versions?

andr-ggn commented 4 years ago
andr-ggn commented 4 years ago

https://github.com/AppsFlyerSDK/AppsFlyerFramework/releases/tag/5.4.1

af-fess commented 4 years ago

We decided to create separate pod spec for MacCatalyst (xcframework) and leave old for iOS only.

For MacCatalyst you can use: https://cocoapods.org/pods/AppsFlyerFramework-MacCatalyst

mr-pant commented 3 years ago

Had the same problem with cocoapods v1.9.3 update to v1.10.1 and it works now.