M
M
Madion2015-12-16 14:04:30
iOS
Madion, 2015-12-16 14:04:30

How to connect yandex metric to ios application?

I do everything according to this instruction. But even the example fails to compile:

Install CocoaPods (http://cocoapods.org/) to manage project dependencies, if you haven't done it yet.
Clone repository: git clone https://github.com/yandexmobile/metrica-sample-ios
Go to cloned repository and install dependencies: pod install
Open project workspace MobileMetricaSample.xcworkspace.
Build and run MobileMetricaSample target.

The compiler always throws this error:
Ld /Users/admin/Library/Developer/Xcode/DerivedData/MobileMetricaSample-atazjhtrmdwgigeaahedcpmhoyrx/Build/Products/Debug-iphonesimulator/MobileMetricaSampleToday.appex/MobileMetricaSampleToday normal x86_64
    cd /Users/admin/ios/metrica-sample-ios
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/MobileMetricaSample-atazjhtrmdwgigeaahedcpmhoyrx/Build/Products/Debug-iphonesimulator -L/Users/admin/ios/metrica-sample-ios/Pods/YandexMobileMetrica -F/Users/admin/Library/Developer/Xcode/DerivedData/MobileMetricaSample-atazjhtrmdwgigeaahedcpmhoyrx/Build/Products/Debug-iphonesimulator -filelist /Users/admin/Library/Developer/Xcode/DerivedData/MobileMetricaSample-atazjhtrmdwgigeaahedcpmhoyrx/Build/Intermediates/MobileMetricaSample.build/Debug-iphonesimulator/MobileMetricaSampleToday.build/Objects-normal/x86_64/MobileMetricaSampleToday.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lFMDB -lKSCrash -lYandexMobileMetrica -lc++ -lprotobuf-c -lsqlite3 -lz -framework AdSupport -framework CoreGraphics -framework CoreLocation -framework CoreTelephony -framework Foundation -framework SystemConfiguration -framework UIKit /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit -e _NSExtensionMain -fobjc-arc -fobjc-link-runtime -fapplication-extension -Xlinker -no_implicit_dylibs -stdlib=libc++ -mios-simulator-version-min=8.0 -framework NotificationCenter -lPods-MobileMetricaSampleToday -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/MobileMetricaSample-atazjhtrmdwgigeaahedcpmhoyrx/Build/Intermediates/MobileMetricaSample.build/Debug-iphonesimulator/MobileMetricaSampleToday.build/Objects-normal/x86_64/MobileMetricaSampleToday_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/MobileMetricaSample-atazjhtrmdwgigeaahedcpmhoyrx/Build/Products/Debug-iphonesimulator/MobileMetricaSampleToday.appex/MobileMetricaSampleToday

/Users/admin/ios/metrica-sample-ios/Pods/YandexMobileMetrica/libYandexMobileMetrica.a(YXStartupParameters.o)
ld: 262 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

(null): 262 duplicate symbols for architecture x86_64
(null): Linker command failed with exit code 1 (use -v to see invocation)

Googled this error. But nothing helps.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
An, 2015-12-16
@Flanker_4

Let's go in order. Perhaps you missed some point.
1) You need to install the cocapods itself. It's a dependency manager that "simplifies" life. The installation manual is available at cocoapods.org/.
2) Then you need to pull off a turnip with an example project https://github.com/yandexmobile/metrica-sample-ios
3) go to the folder with the project and start the terminal from there. Or launch a terminal and drag that folder to the terminal and execute the cd command
4) run the pod intall command in the terminal. After a couple of seconds, the answer pod installed should glow
5) MANDATORY, run not the project file, but the workspace file MobileMetricaSample.xcworkspace
I suspect that you launched the project file, not the workspace file I
suspect that you have

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question