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

Linking fails in a project with Elastic APM iOS package (both SPM) #11

Open
crownvic opened this issue Mar 28, 2024 · 4 comments
Open
Labels
installation For issues that arise during the installation process of the SDK via package managers

Comments

@crownvic
Copy link

πŸ“š AppMetrica SDK Version

5.1.0

πŸ› οΈ Xcode Version

Version 15.3 (15E204a)

πŸ“± Device Information

iPhone 15 simulator iOS 17.4 (21E213)

βš™οΈ Installation Method

Swift Package Manager

πŸ“ Description

AppMetrica is working great in my project. Now I need to add Elastic APM Agent. I tried adding it through SPM from here: https://github.com/elastic/apm-agent-ios (version 1.0.0). But when I build the project (doesn't matter if it's debug or release mode), I get these errors:

duplicate symbol '_protobuf_c_buffer_simple_append' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_empty_string' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_enum_descriptor_get_value' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_enum_descriptor_get_value_by_name' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_check' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_descriptor_get_field' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_descriptor_get_field_by_name' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_free_unpacked' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_get_packed_size' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_init' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_pack' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_pack_to_buffer' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_message_unpack' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_service_descriptor_get_method_by_name' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_service_destroy' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_service_generated_init' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_service_invoke_internal' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_version' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o duplicate symbol '_protobuf_c_version_number' in: hidden/Build/Products/Debug-iphonesimulator/AppMetrica_Protobuf.o hidden/Build/Products/Debug-iphonesimulator/CrashReporter.o ld: 19 duplicate symbols for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Since I'm using Firebase and other Objective-C packages in the project, I have these "other linker flags" set up:

  • For debug builds: -ObjC -ld_classic -Wl
  • For release builds: just -ObjC

πŸ” Reproducing the issue

  1. Add AppMetrica to the project via SPM (it should compile fine)
  2. Add at least -ObjC flag to "Other Linker Flags" in project's build settings
  3. Add https://github.com/elastic/apm-agent-ios (version 1.0.0) via SPM and try to build the project

πŸ“‹ Relevant AppMetrica Log Output or Crash Logs

No response

πŸ“¦ Attach Package.resolved (Swift Package Manager Users)

No response

🍫 Attach Podfile.lock (CocoaPods Users)

No response

@crownvic crownvic added the bug Something isn't working label Mar 28, 2024
@Sergey70
Copy link
Member

Thank you for reporting the issue.
We've identified the problem and working on a fix. This issue will be resolved in the upcoming update.

@GLinnik21
Copy link
Contributor

Hello. I just want to make it clear. Does it reproduce only with the -ObjC flag present in the linker options?

@crownvic
Copy link
Author

Hello. I just want to make it clear. Does it reproduce only with the -ObjC flag present in the linker options?

Well, I created a new empty app project, added AppMetrica, then added Elastic APM Agent, and it also fails without the '-ObjC' flag as well.

@GLinnik21
Copy link
Contributor

Hello @crownvic,

We've reassessed the issue and realized it's more intricate than we initially thought, requiring substantial work beyond a quick fix. Unfortunately, this means a resolution won't be ready for the next release. We're dedicated to finding a solid solution and appreciate your patience.

@GLinnik21 GLinnik21 added installation For issues that arise during the installation process of the SDK via package managers and removed bug Something isn't working labels Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation For issues that arise during the installation process of the SDK via package managers
Projects
None yet
Development

No branches or pull requests

3 participants