Reputation: 188
bitcode bundle could not be generated because '/Users/Hadevs/Desktop/XCodeProjects/KartinaTV/TVVLCKit.framework/TVVLCKit(VLCMedia.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
i know, that it solving by compiling TVVLCKit with full bitcode, but i can't to do it. There's much issues. How can i fix it?
Upvotes: 1
Views: 1550
Reputation: 3147
in order to build the latest build of TVVLCKit successfully, execute the following commands from your terminal:
git clone http://code.videolan.org/videolan/VLCKit.git
cd VLCKit
./buildMobileVLCKit.sh -t
# it will probably stop on error about code.c missing string.h and it will state the declaration of memcpy is incorrect, execute the following lines:
sed -i .bak 's/git pull --rebase/#git pull --rebase/;s/git reset --hard ${TESTEDHASH}/#git reset --hard ${TESTEDHASH}/' buildMobileVLCKit.sh
sed -i .bak -e '/git reset --hard ${TESTEDHASH}/{' -e 'n;s?git am ../../patches/\*.patch?#git am ../../patches/\*.patch?' -e'}' buildMobileVLCKit.sh
cd MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/gsm/src
cp code.c code.bak
echo -e "#include <string.h>\n$(cat code.c)" > code.c
cd ../../../../../../..
cd MobileVLCKit/ImportedSources/vlc/contrib/AppleTVSimulator-x86_64/gsm/src
cp code.c code.bak
echo -e "#include <string.h>\n$(cat code.c)" > code.c
cd ../../../../../../..
./buildMobileVLCKit.sh -t
# now you should be able to see the "all done" message, now lets xCode build (you can change the tvOS version from 9.2 to 9.1 if you need), (note the bit code generation option)
xcodebuild -project "MobileVLCKit.xcodeproj" -target "TVVLCKit" -sdk appletvos9.2 -configuration Release ARCHS="arm64" IPHONEOS_DEPLOYMENT_TARGET=9.2 GCC_PREPROCESSOR_DEFINITIONS="" BITCODE_GENERATION_MODE=bitcode
xcodebuild -project "MobileVLCKit.xcodeproj" -target "TVVLCKit" -sdk appletvsimulator9.2 -configuration Release ARCHS="x86_64" IPHONEOS_DEPLOYMENT_TARGET=9.2 GCC_PREPROCESSOR_DEFINITIONS="" BITCODE_GENERATION_MODE=bitcode
# you can also create the framework file for both simulator and red apple tv with the following lines:
cd build
rm -rf TVVLCKit.framework
mkdir TVVLCKit.framework
lipo -create Release-appletvos/libTVVLCKit.a Release-appletvsimulator/libTVVLCKit.a -o TVVLCKit.framework/TVVLCKit
chmod a+x TVVLCKit.framework/TVVLCKit
cp -pr Release-appletvos/TVVLCKit TVVLCKit.framework/Headers
after this you can find the "libTVVLCKit.a" file for real apple tv at: "VLCKit/build/Release-appletvos" and the "libTVVLCKit.a" for the Xcode simulator at: "VLCKit/build/Release-appletvsimulator"
the framework file will be located at: "VLCKit/build/TVVLCKit.framework"
in order to test it drag the "TVVLCKit.framework" to your project and include the following frameworks as well in your project:
not sure they are all required,
if you are using swift, then create a bridge header file and write this import statement:
#import <TVVLCKit/TVVLCKit.h>
here is a small swift example to play a stream / file:
var appDelegate: AppDelegate!
appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
player = VLCMediaPlayer()
player.media = VLCMedia(URL: NSURL(string: "http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4"))
player.play()
player.drawable = appDelegate.window // or self.view if this code is in a UIViewController
Upvotes: 2