matomo-org / matomo-sdk-ios

Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
MIT License
388 stars 164 forks source link

Can't add and use piwik in my project ios objective-c #281

Closed ElFrancky closed 6 years ago

ElFrancky commented 6 years ago

Hi, I not able to use Piwik in my project objective-c iOS. this is my podfile : platform :ios, '9.0' target 'test' do pod 'PiwikTracker', '~> 4.4' end ` I've done this configuration: Add a random .swift file to your project. You can delete if from the project right away. In you main target select the Swift version to 4.2 perform a pod install

when I compile the project, j've got this issue : `Ld /Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Products/Debug-iphoneos/SyspreNomade.app/SyspreNomade normal arm64 (in target: SyspreNomade) cd /Users/Francky/Developer/SYSPRENomade-iOS/Trunk export IPHONEOS_DEPLOYMENT_TARGET=8.0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk -L/Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Products/Debug-iphoneos -L/Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Products/Debug-iphoneos/MatomoTracker -L/Users/Francky/Developer/SYSPRENomade-iOS/Trunk/SyspreNomade -F/Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Products/Debug-iphoneos -F/Users/Francky/Developer/SYSPRENomade-iOS/Trunk -filelist /Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Intermediates.noindex/SyspreNomade.build/Debug-iphoneos/SyspreNomade.build/Objects-normal/arm64/SyspreNomade.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Intermediates.noindex/SyspreNomade.build/Debug-iphoneos/SyspreNomade.build/Objects-normal/arm64/SyspreNomade_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Intermediates.noindex/SyspreNomade.build/Debug-iphoneos/SyspreNomade.build/Objects-normal/arm64/SyspreNomade.swiftmodule -force_load /Users/Francky/Developer/SYSPRENomade-iOS/Trunk/AppConnect.framework/AppConnect -framework LocalAuthentication -lProtocolBuffers -framework Security -framework AppConnect -framework QuartzCore -framework CoreGraphics -framework Fabric -lcrypto -framework CoreData -framework UIKit -framework Foundation -framework Crashlytics -lPods-SyspreNomade -Xlinker -dependency_info -Xlinker /Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Intermediates.noindex/SyspreNomade.build/Debug-iphoneos/SyspreNomade.build/Objects-normal/arm64/SyspreNomade_dependency_info.dat -o /Users/Francky/Library/Developer/Xcode/DerivedData/SyspreNomade-dvmqezexsmolsbdqectrfcepomqr/Build/Products/Debug-iphoneos/SyspreNomade.app/SyspreNomade

Undefined symbols for architecture arm64: "_OBJCCLASS$__TtC13MatomoTracker13MatomoTracker", referenced from: objc-class-ref in TextViewController.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) `

Thanks for your help

ElFrancky commented 6 years ago

I've resolved the problem by adding '$(inherited)' in Main Target > BUILD SETTINGS >Other linker flags

brototyp commented 6 years ago

Great to hear you got it solved. Welcome to Matomo 👋