Question

I have added BurstlySDK and TestFlightSDK to my project and i'm having the following linker error:

duplicate symbol _OBJC_CLASS_$_TFApplicationInformation in:
/Users/Andrey/Documents/Helicopter/helicopter_clone/HelicopterClone/BurstlySDK/libBurstly.a(TFApplicationInformation.o)
/Users/Andrey/Documents/Helicopter/helicopter_clone/HelicopterClone/TestFlightSDK2/libTestFlight.a(TFApplicationInformation.o)

The adduced TFApplicationInformation is just an example. About ten classes with TF prefix are mentioned in error message. Can anybode explain why it happens? Thanks

Was it helpful?

Solution 2

From Burslty iOS integration guide:

Note: The TestFlight SDK has been bundled with SkyRocket since 2.X

http://quickstart.burstly.com/ios-release-notes

OTHER TIPS

Since the TestFlight SDK is bundled with the SkyRocket SDK, you need not link in libTestFlight.a but you do need to keep TestFlight.h in your project as well as importing that header in classes when you need to use TestFlight functionality. If you do not have TestFlight.h (it should be bundled with the TestFlight SDK in its entirety), you can download the TestFlight SDK here: https://testflightapp.com/sdk/download/

Burstly support recommended removing libTestFlight.a as Alex M suggested above, but this made me nervous because I get the sense that Burstly dedicates more resources toward maintaining the TestFlight SDK than the SkyRocket SDK. Admittedly, this gut feeling may be a figment of my imagination, but I couldn't shake it.

So, I wrote this script instead. It strips the duplicate symbols out of libBurstly.a and outputs a libBurstly-noTestFlight.a, which can be linked without conflict. The paths are hard coded for my current project, so you'll have to adapt the script for your own project if you want to use it.

#!/bin/bash

# I install this script as $(SRCROOT)/scripts/strip_tf_duplicate_symbols, and 
# run it from $(SRCROOT).  
# It looks for libBurstly.a under $(SRCROOT)/Vendors/BurstlySDK.
# Sorry about the hard-coded paths.  I didn't design this to be used in other projects.

if [ -d ./Vendors/BurstlySDK ]
then
    echo "Preparing to strip duplicate symbols from libBurstly.a..."
else
    echo "Creates Vendors/BurstlySDK/libBurstly-noTestFlight.a with duplicate symbols removed."
    echo "Usage: run ./scripts/strip_tf_duplicate_symbols from the Xcode project root"
    exit
fi

cd Vendors/BurstlySDK

echo "Breaking fat libBurstly.a into separate armv7 and i386 libraries..."
xcrun -sdk iphoneos lipo -thin armv7 libBurstly.a -output libBurstly-armv7.a
xcrun -sdk iphoneos lipo -thin armv7s libBurstly.a -output libBurstly-armv7s.a
xcrun -sdk iphoneos lipo -thin i386 libBurstly.a -output libBurstly-i386.a

echo "Extracting .o files into architecture-specific subdirectories..."
mkdir -p libBurstly-armv7 libBurstly-armv7s libBurstly-i386
cd libBurstly-i386
ar -x ../libBurstly-i386.a
cd ..
cd libBurstly-armv7
ar -x ../libBurstly-armv7.a
cd ..
cd libBurstly-armv7s
ar -x ../libBurstly-armv7s.a
cd ..

echo "Removing .o files with duplicate symbols..."
rm  */TF_OpenUDID.o
rm  */TFMessagePack.o
rm  */TestFlight.o
rm  */TFReachability.o
rm */TFNetworkManager.o
rm */TFMemoryMonitor.o
rm */TFDeviceInfo.o
rm */TFCrypto.o
rm */TFApplicationInformation.o


echo "Repacking architecture-specific .a files..."
cd libBurstly-i386
xcrun -sdk iphoneos libtool -static -o ../libBurstly-i386.a *.o 
cd ..
cd libBurstly-armv7
xcrun -sdk iphoneos libtool -static -o ../libBurstly-armv7.a *.o 
cd ..
cd libBurstly-armv7s
xcrun -sdk iphoneos libtool -static -o ../libBurstly-armv7s.a *.o 
cd ..

echo "Recombining thin files into libBurstly-noTestFlight.a"
xcrun -sdk iphoneos lipo -create libBurstly-i386.a libBurstly-armv7.a libBurstly-armv7s.a -output libBurstly-noTestFlight.a

echo "Cleaning up..."
rm -rf libBurstly-armv7 libBurstly-armv7s libBurstly-i386

ls -1 libBurstly-noTestFlight.a
echo "Done"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top