firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

compile error:Could not find or use auto-linked library 'swiftCompatibility50': library 'swiftCompatibility50' not found

Open ibabyblue opened this issue 11 months ago • 3 comments

Description

Hello, I manually updated the relevant SDK in the Objective-c project, and the compilation error is as follows: ld: warning: Could not find or use auto-linked library 'swiftCompatibility50': library 'swiftCompatibility50' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibility51': library 'swiftCompatibility51' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibilityConcurrency': library 'swiftCompatibilityConcurrency' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements': library 'swiftCompatibilityDynamicReplacements' not found ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found ld: Undefined symbols: _OBJC_CLASS_$_FIRHeartbeatController, referenced from: in FirebaseCore[13](FIRHeartbeatLogger.o) __swift_FORCE_LOAD_$_swiftCompatibility50, referenced from: __swift_FORCE_LOAD_$_swiftCompatibility50_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o) __swift_FORCE_LOAD_$_swiftCompatibility51, referenced from: __swift_FORCE_LOAD_$_swiftCompatibility51_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o) __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency, referenced from: __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o) __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements, referenced from: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o) clang: error: linker command failed with exit code 1 (use -v to see invocation) What can I do to solve this problem?Thank you for your help!

image image 上图是更新的相关SDK。

Reproducing the issue

No response

Firebase SDK Version

10.23.0

Xcode Version

15.2

Installation Method

Zip

Firebase Product(s)

Analytics, Crashlytics

Targeted Platforms

iOS

Relevant Log Output

ld: warning: Could not find or use auto-linked library 'swiftCompatibility50': library 'swiftCompatibility50' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibility51': library 'swiftCompatibility51' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityConcurrency': library 'swiftCompatibilityConcurrency' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements': library 'swiftCompatibilityDynamicReplacements' not found
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: Undefined symbols:
  _OBJC_CLASS_$_FIRHeartbeatController, referenced from:
       in FirebaseCore[13](FIRHeartbeatLogger.o)
  __swift_FORCE_LOAD_$_swiftCompatibility50, referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibility50_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o)
  __swift_FORCE_LOAD_$_swiftCompatibility51, referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibility51_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o)
  __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency, referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o)
  __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements, referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_FirebaseAnalytics in FirebaseAnalytics[17](Analytics+StoreKit.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

ibabyblue avatar Mar 21 '24 11:03 ibabyblue

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 21 '24 11:03 google-oss-bot

Make sure you follow the zip distribution's README instructions. It looks like FirebaseCoreInternal is missing from the Analytics folder.

paulb777 avatar Mar 21 '24 13:03 paulb777

AutoPlay

MarkingQ avatar Mar 22 '24 09:03 MarkingQ

@ibabyblue

You can try as commented below.

(https://github.com/facebookarchive/react-native-fbsdk/issues/755#issuecomment-644528297)

TranTrieuLamQuynh avatar Mar 25 '24 06:03 TranTrieuLamQuynh

@paulb777 @TranTrieuLamQuynh Thank you very much for your reply, I have done it again according to README, but there is still one error, that is: ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found image

To solve this problem, deleting '-ObjC' from Other Linker Flags in Build Settings will compile, but in my project '-ObjC' is required. How do I deal with this? Thank you!

ibabyblue avatar Mar 25 '24 06:03 ibabyblue

After I removed "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)" from LIBRARY_SEARCH_PATHS, the compilation was successful, which is to prevent loss of Swift system libraries Added when the symbolic linker was wrong, now it must be deleted to work... On the one hand to add, on the other hand to delete, dizzy, but still want to thank the reply ~

ibabyblue avatar Mar 26 '24 07:03 ibabyblue