Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
168 stars 140 forks source link

Move `CoreTelephony` to `frameworks` in Podspec #189

Closed freak4pc closed 5 years ago

freak4pc commented 5 years ago

For some reason, CoreTelephony is weakly linked even though it is mandatory for building the AppBoy SDK.

Otherwise build fails with CocoaPods:

Ld /Users/shai.mishali/Library/Developer/Xcode/DerivedData/**-gwszrgdelbsrniendrgtooxqlgxt/Build/Products/Debug-iphonesimulator/Appboy-iOS-SDK/Appboy_iOS_SDK.framework/Appboy_iOS_SDK normal x86_64 (in target: Appboy-iOS-SDK)
    cd /Users/**********************
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -L/Users/shai.mishali/Library/Developer/Xcode/DerivedData/****-gwszrgdelbsrniendrgtooxqlgxt/Build/Products/Debug-iphonesimulator/Appboy-iOS-SDK -L/Users/****/Pods/Appboy-iOS-SDK/AppboyKit -F/Users/shai.mishali/Library/Developer/Xcode/DerivedData/****-gwszrgdelbsrniendrgtooxqlgxt/Build/Products/Debug-iphonesimulator/Appboy-iOS-SDK -F/Users/shai.mishali/Library/Developer/Xcode/DerivedData/****-gwszrgdelbsrniendrgtooxqlgxt/Build/Products/Debug-iphonesimulator/FLAnimatedImage -F/Users/shai.mishali/Library/Developer/Xcode/DerivedData/****-gwszrgdelbsrniendrgtooxqlgxt/Build/Products/Debug-iphonesimulator/SDWebImage -filelist /Users/shai.mishali/Library/Developer/Xcode/DerivedData/*****-gwszrgdelbsrniendrgtooxqlgxt/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Appboy-iOS-SDK.build/Objects-normal/x86_64/Appboy_iOS_SDK.LinkFileList -install_name @rpath/Appboy_iOS_SDK.framework/Appboy_iOS_SDK -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/shai.mishali/Library/Developer/Xcode/DerivedData/*****-gwszrgdelbsrniendrgtooxqlgxt/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Appboy-iOS-SDK.build/Objects-normal/x86_64/Appboy_iOS_SDK_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -fprofile-instr-generate -ObjC -lAppboyKitLibrary -lz -ObjC -framework CoreText -framework Foundation -framework QuartzCore -framework SDWebImage -framework SystemConfiguration -framework WebKit -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/shai.mishali/Library/Developer/Xcode/DerivedData/*****-gwszrgdelbsrniendrgtooxqlgxt/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Appboy-iOS-SDK.build/Objects-normal/x86_64/Appboy_iOS_SDK_dependency_info.dat -o /Users/shai.mishali/Library/Developer/Xcode/DerivedData/*****-gwszrgdelbsrniendrgtooxqlgxt/Build/Products/Debug-iphonesimulator/Appboy-iOS-SDK/Appboy_iOS_SDK.framework/Appboy_iOS_SDK

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
      objc-class-ref in libAppboyKitLibrary.a(ABKDevice.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

image

Bucimis commented 5 years ago

@freak4pc thanks for opening a PR.

We have a few questions on our end: 1) what version of Cocoapods/Xcode are you using? 2) could you provide concrete steps to repro?

We have a number of sample apps that do not link CoreTelephony and successfully build with the public Appboy pod using Cocoapods 1.6.1 and XCode 10.1

freak4pc commented 5 years ago

I'm on 1.7.0.rc1 and Xcode 10.2.1. I'll see if I can make a standalone repro project.

freak4pc commented 5 years ago

@Bucimis Able to reproduce it with CocoaPods 1.6.0 and Xcode 10.2.1. AppBoyTest.zip

Or just make a blank project with this Podfile:

target 'AppBoyTest' do
  use_frameworks!

  # Build Fails:
  pod 'Appboy-iOS-SDK', '3.12.0'

  # Builds (Uncomment to test):
  # pod 'Appboy-iOS-SDK', :git => 'https://github.com/freak4pc/appboy-ios-sdk', :branch => 'coretelephony-nonweak'
end
freak4pc commented 5 years ago

Apparently this was fixed in 1.6.1. Your project was an example for the bug :)

https://github.com/CocoaPods/CocoaPods/issues/8493

https://github.com/CocoaPods/CocoaPods/pull/8498