microsoft / appcenter-sdk-apple

Development repository for the App Center SDK for iOS, macOS and tvOS.
Other
563 stars 223 forks source link

Protobuf: could not find object file symbol for symbol #2514

Closed eaigner closed 10 months ago

eaigner commented 11 months ago

Description

Since macOS 14.0 Xcode 15 always spits out those warnings on compile

warning: (arm64)  could not find object file symbol for symbol _protobuf_c_version
warning: (arm64)  could not find object file symbol for symbol _protobuf_c_empty_string
warning: (arm64)  could not find object file symbol for symbol _plcrash_async_byteorder_swapped
warning: (arm64)  could not find object file symbol for symbol _protobuf_c__allocator
warning: (arm64)  could not find object file symbol for symbol _shared_image_list

Protobuf seems to be a dependency of PLCrashReporter

Repro Steps

  1. Compile a project with AppCenter included on macOS 14 / Xcode 15

Details

  1. Which SDK version are you using?
    • 5.0.4
  2. Which OS version did you experience the issue on?
    • macOS 14.0 and 14.1
  3. Which Xcode version did you build the app with?
    • Xcode 15.0.1 (15A507)
  4. Which Cocoapods version are you using (run pod --version)?
    • NONE
  5. What device version did you see this error on? Were you using an emulator or a physical device?
    • Mac mini Pro M2
  6. What language are you using?
    • [ ] Objective C
    • [x] Swift
  7. What third party libraries are you using?
  8. Please enable verbose logging for your app using MSAppCenter.setLogLevel(.verbose) before your call to MSAppCenter.start(...) for Swift, or [MSAppCenter setLogLevel:MSLogLevelVerbose] before [MSAppCenter start: ...] for Objective C and include the logs here:
DmitriyKirakosyan commented 10 months ago

Hi @eaigner, thank you for reaching out! Could you please clarify how you've integrated the AppCenter SDK? Did you use project dependency, SPM, Cocoapods, or binaries?

art-ghub commented 10 months ago

Hi, I'm observing same issue, absolutely same conditions except 1. SDK is 5.0.3. Using SPM.

DmitriyKirakosyan commented 10 months ago

@art-ghub , apart from the warnings, does the SDK work correctly? Have you tried integrating it via cocoapods or binaries instead of SPM and check if it helps?

art-ghub commented 10 months ago

No, I haven't tried. These are not a linker warnings, they are fired on .dSYM generation stage:

GenerateDSYMFile /Users/<skipped>.app.dSYM <skipped>.app/<skipped> (in target '<skipped>' from project '<skipped>')

DmitriyKirakosyan commented 10 months ago

@art-ghub thanks for the clarification. Do these warnings cause any actual problems? Any issues spotted with the SDK in action?

@eaigner, are you also encountering the dSYM issue on your end?

DmitriyKirakosyan commented 10 months ago

This issue will be closed due to inactivity. If the problem continues, please feel free to reopen it or let me know.

francosolerio commented 9 months ago

The issue is still present.

warning: (arm64)  could not find object file symbol for symbol _protobuf_c_version
warning: (arm64)  could not find object file symbol for symbol _protobuf_c_empty_string
warning: (arm64)  could not find object file symbol for symbol _plcrash_async_byteorder_swapped
warning: (arm64)  could not find object file symbol for symbol _protobuf_c__allocator
warning: (arm64)  could not find object file symbol for symbol _shared_image_list
eaigner commented 9 months ago

I use SPM. And the issue is still present Dec 23 - Xcode Version 15.1 (15C65), macOS 14.2.1 (23C71), AppCenter 5.0.4

MikhailSuendukov commented 8 months ago

Hi guys, and sorry for long delay. Could you please provide more details on whether these warnings are leading to any specific issues? Have you noticed any anomalies or problems with the SDK's functionality as a result?

francosolerio commented 8 months ago

No specific issues observed, but keeping our compilation results clean is always good code hygiene. When you let warnings accumulate, sooner or later you will not catch the one that will put you in trouble. For this reason some dev teams turn on "treat compiler warnings as errors" as company policy, in this case AppCenter becomes unusable.

MikhailSuendukov commented 8 months ago

I tried to reproduce this error on an empty project, but when building the application, such warnings did not occur. Therefore, it would be very useful to further investigation of this error to get a small demo application on which this error will be reproduced.

francosolerio commented 7 months ago

Create a new project in XCode (iOS app, SwiftUI). Add package App Center. Instead of simple Build issue an Archive command (menu: Product -> Archive). Look in the issue navigator.

If you enable DWARF with DSYM File in the build options for debug builds, you will see the same warnings issuing a simple build command too.

You can download a sample project here: https://digitalia-media.s3-eu-west-1.amazonaws.com/temp/AppCenterTest.zip

patrickhartling commented 7 months ago

We see the very same warnings from the linker when building our app using Xcode 15.0 through the current 15.3 beta. Our use of PLCrashReporter via SPM comes in from a different Swift package entirely. In other words, we do not use the AppCenter SDK, but PLCrashReporter and its use of protobuf leads to the same warnings when linking the application binary.

MikhailSuendukov commented 7 months ago

Hi everyone, and sorry for the long delay, and thanks for your demo application, I was able to reproduce this behavior. Indeed, these warnings come from the PLCrashReporter package. Hi @patrickhartling, could you please confirm what this warning is reproducible on version 14 of xCode?

patrickhartling commented 7 months ago

@MikhailSuendukov The app I work on now requires Swift 5.9 and will not build with Xcode 14. Hence, I cannot get to the point where the linker would be run. I am quite confident, though, that these warnings from the linker started with Xcode 15.0.

lksoft commented 7 months ago

I am seeing the same warnings for a macOS app that has only PLCrashReporter added/linked into it. I am not seeing any visible issues, however, as @francosolerio mentioned we like to keep the project clean to identifier real errors easier.

The app is a mix of Obj-C & Swift. The code is being called from Obj-C, though i doubt that has an impact. Building in Xcode 15.2 on Sonoma 14.2.1. PLCrashReporter was added via SPM.

Hope that helps.

BTW, I am adding here, since this was literally the only hit for the error message I got and seemed appropriate, despite it obviously being an issue with PLCrashReporter instead of the AppCenter SDK.

Sorry if that is inappropriate.

patrickhartling commented 7 months ago

@lksoft

this was literally the only hit for the error message I got and seemed appropriate

That was my experience as well. I was relieved to find this issue because it seemed like no one else was experiencing the reported behavior.

despite it obviously being an issue with PLCrashReporter instead of the AppCenter SDK.

I have tried to create a standalone project that just has PLCrashReporter as a dependency but have yet to be able to reproduce the warnings that way. I wonder if the combination of Objective-C and Swift is somehow a factor. It sounds like we're in a similar arrangement to you in terms of languages and tools, though in our case, it's Swift code that called into the PLCrashReporter package.

Ginluck commented 4 months ago

These types of warnings are as high as 70000 in my XCode, causing me to experience abnormal lag every time I compile a project. Please let me know the solution. Thank you ![Uploading 123.png…]()

patrickhartling commented 4 months ago

FWIW, we aren't seeing the warning from the linker related to PLCrashReporter when using Xcode 15.3.

Ginluck commented 4 months ago

FWIW,在使用 Xcode 15.3 时,我们没有看到来自与 PLCrashReporter 相关的链接器的警告。 My warning is not related to PLCrashReporter. Please pay attention to the image I provided and inform me of how to address the issue. Thank you for the trouble you are going through. 123

Ginluck commented 3 months ago

值得一提的是,当使用 Xcode 15.3 时,我们没有看到与 PLCrashReporter 相关的链接器的警告。

331421290-6d248b8f-f253-442f-b07c-91c852313ae4 can you help me what can i do ;i feel so sad with xcode

xxyu98 commented 2 months ago

image Flutter encountered similar issues after using the Gaode SDK, accompanied by XCode editing lag and frequent 100% cuping