at-internet / atinternet-apple-sdk

AT Internet mobile analytics solution for Apple devices
http://www.atinternet.com
MIT License
25 stars 47 forks source link

iOS SDK compatibility issues. #36

Closed seamuscantillon closed 5 years ago

seamuscantillon commented 6 years ago

Hello,

We're trying to release a build but testing on iOS 12 beta we get the following runtime error that crashes the app:

dyld: Symbol not found: __T0BOWV Referenced from: /private/var/containers/Bundle/Application/0D4E3182-9580-4035-B8B3-0BCC4DD885AF/RTÉ Player.app/Frameworks/Tracker.framework/Tracker Expected in: /private/var/containers/Bundle/Application/0D4E3182-9580-4035-B8B3-0BCC4DD885AF/RTÉ Player.app/Frameworks/libswiftCore.dylib in /private/var/containers/Bundle/Application/0D4E3182-9580-4035-B8B3-0BCC4DD885AF/RTÉ Player.app/Frameworks/Tracker.framework/Tracker

When will there be a release of the framework that supports iOS12 and can be built using either Xcode 10 and Xcode 9?

d-theo commented 6 years ago

It looks like using cocoapods it works on iOS12. I just tried on a fresh project with this configuration (FYI 2.9.8 is the same as 'develop' right row) on xCode 10 / iPhone6-iOS12 and it worked.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'freshproj' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!
  pod "ATInternet-Apple-SDK/Tracker", :git => 'https://github.com/at-internet/atinternet-apple-sdk.git', :branch => 'develop'
  # Pods for freshproj
end

I reproduced this bug with an already compiled version of the Tracker (xCode-9.4) available on TagComposer, but for some reason Swift dynamic frameworks are not very portable across xCode versions so that might be your issue ?

seamuscantillon commented 6 years ago

Thanks for your reply. I've tried the above but when I try the above in a fresh obj-c project and try to import with: #import <Tracker/Tracker.h>

I get: Declaration of 'Tracker' must be imported from module 'Tracker.Swift' before it is required

If I try to import it as a module, I get hundreds of linker errors: @import Tracker; Or if I try to import Tracker-Swift.h, I still get the linker errors.

Any help you can provide is greatly appreciated.

d-theo commented 6 years ago

Is this this error ?

linker

Hope Swift5 will fix all the mess introduced in Swift4... I don't know if it's a "new bug" introduced by cocoapods, xCode or Swift4.1. The Bridging-Header is not auto-generated anymore, so the linker error "quick-fix" is to create a new swift file inside the project, let xCode generate the bridging file and everything works again... :/

I uploaded a sample project where it works (you need to pod install though) https://s3-eu-west-1.amazonaws.com/tag-miscs-dev/beta-apple/fresh-objc.zip

seamuscantillon commented 6 years ago

Adding a blank swift file seems to have done the trick! Thank you!!

I wasn't able to use the sample project - probably due to different version of cocoapods, but that doesn't matter now.

Also, I had to import the module rather than Tracker-Swift.h. If I import Tracker-Swift.h, I am able to run debug builds but I'm not able to create an archive - I get the following: Undefined symbols for architecture arm64: "_OBJCCLASS$__TtC7Tracker10ATInternet", referenced from: objc-class-ref in AnalyticsManager.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Again, that's not a problem for me, I just thought I'd let you know. Thanks again!

d-theo commented 6 years ago

Thank you for the feedback, I think we should update the doc because there are a lot of strange cases with objc/swift mixes, and Cocoapods doesn't really helps