当我尝试存档项目时 - 位码错误



无法生成位码包,因为 '/Users/Hadevs/Desktop/XCodeProjects/KartinaTV/TVVLCKit.framework/TVVLCKit(VLCMe dia.o(' 是在没有完整位码的情况下构建的。的所有对象文件和库 位码必须从 Xcode 存档或安装构建生成 架构 ARM64

我知道,它通过使用完整的位码编译 TVVLCKit 来解决,但我做不到。有很多问题我该如何解决它?

为了成功构建最新版本的 TVVLCKit,请从终端执行以下命令:

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
在此之后,您可以在以下位置找到Real Apple TV的"libTVVLCKit.a"文件:"VLCKit/build/

Release-appletvos"和Xcode模拟器的"libTVVLCKit.a":"VLCKit/build/Release-appletvsimulator">

框架文件将位于:"VLCKit/build/TVVLCKit.framework">

为了测试它,将"TVVLCKit.framework"拖到您的项目中,并在您的项目中包括以下框架:

  • AudioToolbox.framework
  • OpenGLES.framework
  • CFNetwork.framework
  • CoreText.framework
  • libbz2.tbd
  • libiconv.tbd
  • CoreGraphics.framework
  • 安全框架
  • libc++.tbd
  • CoreVideo.framework
  • 媒体播放器框架
  • QuartzCore.framework

不确定它们都是必需的,

如果您使用的是 Swift,则创建一个桥头文件并编写以下 import 语句:

#import <TVVLCKit/TVVLCKit.h>

下面是一个播放流/文件的小型 swift 示例:

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

最新更新