braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: Braze SDK 8.2.1 not compiling #117

Closed hassaan4584 closed 7 months ago

hassaan4584 commented 7 months ago

Platform

iOS

Platform Version

iOS 17.2

Braze SDK Version

8.2.1

Xcode Version

Xcode 15.0.1

Computer Processor

Apple (M1)

Repro Rate

100% of the times

Steps To Reproduce

Steps to reproduce:

  1. Create an empty project
  2. Add braze sdk using spm - https://github.com/braze-inc/braze-swift-sdk
  3. Add only the "BrazeKit" to your project
  4. Update your AppDelegate file to setup Braze.Configuration from this link
  5. As soon as we add the line let config = Braze.Configuration(apiKey: "api-Key", endpoint: "sdk.eu") the build starts to fail.
Screenshot 2024-03-27 at 17 25 40

Below is a sample Project that problems while compiling Braze Failing Integration.zip

Expected Behavior

When we integrate Braze SDK using SPM, and use Braze.Configuration in AppDelegate, it should successfully compile and run

Actual Incorrect Behavior

When we integrate BrazeSDK using SPM and use Braze.Configuration(apiKey: "api-Key", endpoint: "sdk.eu") , the app stops to compile

Verbose Logs

Ld /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Products/Debug-iphonesimulator/Braze\ Failing\ Integration.app/Braze\ Failing\ Integration normal (in target 'Braze Failing Integration' from project 'Braze Failing Integration')
    cd /Users/hassaanahmed/Documents/XcodeProjects/Experiments/16\ Braze\ Integration/Braze\ Failing\ Integration
    /Applications/Xcode-15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios17.0-simulator -isysroot /Applications/Xcode-15.0.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk -O0 -L/Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Products/Debug-iphonesimulator -F/Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Products/Debug-iphonesimulator -filelist /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/Braze\ Failing\ Integration.build/Debug-iphonesimulator/Braze\ Failing\ Integration.build/Objects-normal/arm64/Braze\ Failing\ Integration.LinkFileList -Xlinker -rpath -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Products/Debug-iphonesimulator/PackageFrameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/Braze\ Failing\ Integration.build/Debug-iphonesimulator/Braze\ Failing\ Integration.build/Objects-normal/arm64/Braze\ Failing\ Integration_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode-15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/Braze\ Failing\ Integration.build/Debug-iphonesimulator/Braze\ Failing\ Integration.build/Objects-normal/arm64/Braze_Failing_Integration.swiftmodule -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/Braze\ Failing\ Integration.build/Debug-iphonesimulator/Braze\ Failing\ Integration.build/Braze\ Failing\ Integration.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/Braze\ Failing\ Integration.build/Debug-iphonesimulator/Braze\ Failing\ Integration.build/Braze\ Failing\ Integration.app-Simulated.xcent.der -framework BrazeKit -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/Braze\ Failing\ Integration.build/Debug-iphonesimulator/Braze\ Failing\ Integration.build/Objects-normal/arm64/Braze\ Failing\ Integration_dependency_info.dat -o /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Products/Debug-iphonesimulator/Braze\ Failing\ Integration.app/Braze\ Failing\ Integration -Xlinker -add_ast_path -Xlinker /Users/hassaanahmed/Library/Developer/Xcode/DerivedData/Braze_Failing_Integration-diuiccobzqsvtmbqfsrhunvirhcj/Build/Intermediates.noindex/braze-swift-sdk.build/Debug-iphonesimulator/BrazeKitResources.build/Objects-normal/arm64/BrazeKitResources.swiftmodule

ld: warning: Could not find or use auto-linked framework 'BrazeArchitecture': framework 'BrazeArchitecture' not found
ld: warning: Could not find or use auto-linked framework 'BrazeCasePaths': framework 'BrazeCasePaths' not found
ld: warning: Could not find or use auto-linked framework 'BrazeComposableArchitecture': framework 'BrazeComposableArchitecture' not found
ld: warning: Could not find or use auto-linked framework 'NanoCombine': framework 'NanoCombine' not found
ld: warning: Could not find or use auto-linked framework 'NanoCombineExt': framework 'NanoCombineExt' not found
ld: warning: Could not find or use auto-linked framework '_BrazeAssetsClient': framework '_BrazeAssetsClient' not found
ld: warning: Could not find or use auto-linked framework '_BrazeUnzipClient': framework '_BrazeUnzipClient' not found
ld: warning: Could not find or use auto-linked framework '_BrazeUtils': framework '_BrazeUtils' not found

ld: Undefined symbols:
  static ActivityKit.Activity.pushToStartTokenUpdates.getter : ActivityKit.Activity<A>.PushTokenUpdates, referenced from:
      (1) suspend resume partial function for closure #2 @Sendable () async -> () in BrazeKit.Braze.LiveActivities.registerPushToStart<A where A: ActivityKit.ActivityAttributes, A: BrazeKit.BrazeLiveActivityAttributes>(forType: ActivityKit.Activity<A>.Type, name: Swift.String) -> Swift.Task<(), Swift.Never> in BrazeKit[arm64][2](BrazeKit-arm64-master.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Additional Information

No response

hokstuff commented 7 months ago

Hi @hassaan4584,

Since you are using Braze SDK version 8.2.1, you will need to use Xcode 15.2+ in order to compile successfully, as noted in our breaking changes in the 8.0.0 release notes. Feel free to reopen if you continue to have issues compiling when using the updated version of Xcode.

Thanks!