加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 让MobileVLCKit通过Cocoapods工作

发布时间:2020-12-14 19:04:17 所属栏目:百科 来源:网络整理
导读:我一直在努力让VLC在我的iOS应用程序中工作一段时间.使用 Cocoapods,MobileVLCKit被导入到我的项目中.当我现在运行应用程序时,它编译没有问题.但是,当我在MobileVLCKit(MobileVLCKit.h,VLCMediaPlayer.h)中包含任何内容时,应用程序崩溃,告诉我没有找到符号.
我一直在努力让VLC在我的iOS应用程序中工作一段时间.使用 Cocoapods,MobileVLCKit被导入到我的项目中.当我现在运行应用程序时,它编译没有问题.但是,当我在MobileVLCKit(MobileVLCKit.h,VLCMediaPlayer.h)中包含任何内容时,应用程序崩溃,告诉我没有找到符号.
这是崩溃:

Ld /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos/Cameras.app/Cameras normal arm64
    cd /Users/JohnDoe/ios-cam-app/iOSCamApp
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -L/Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos -LLibraries -LLibraries/FFmpeg -LLibraries/kxmovie -LLibraries/MBProgressHUD -LLibraries/Nabto -LLibraries/FFmpeg/include -LLibraries/kxmovie/kxmovie.bundle -LLibraries/Nabto/include -LLibraries/Nabto/lib -LLibraries/FFmpeg/include/libavcodec -LLibraries/FFmpeg/include/libavdevice -LLibraries/FFmpeg/include/libavfilter -LLibraries/FFmpeg/include/libavformat -LLibraries/FFmpeg/include/libavutil -LLibraries/FFmpeg/include/libswresample -LLibraries/FFmpeg/include/libswscale -L/Users/JohnDoe/ios-cam-app/iOSCamApp/Libraries/FFmpeg -L/Users/JohnDoe/ios-cam-app/iOSCamApp/Libraries/Nabto/lib -F/Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos -FFrameworks -F/Users/JohnDoe/ios-cam-app/iOSCamApp -filelist /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Intermediates/iOSCamApp.build/Debug-iphoneos/iOSCamApp.build/Objects-normal/arm64/Cameras.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -lPods-AFNetworking -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lstdc++.6.0.9 -lc++ -liconv.2.4.0 -lbz2 -lz -framework MediaPlayer -framework CoreAudio -framework Crashlytics -framework AudioToolbox -framework Accelerate -framework OpenGLES -lnabto_static_external -framework CoreVideo -framework CoreMedia -framework CFNetwork -framework AVFoundation -lavutil -lavfilter -lPods -lavdevice -lswscale -lnabto_client_api_static -framework Fabric -lavformat -lswresample -lavcodec -framework QuartzCore -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Intermediates/iOSCamApp.build/Debug-iphoneos/iOSCamApp.build/Objects-normal/arm64/Cameras_dependency_info.dat -o /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos/Cameras.app/Cameras
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_VLCMediaPlayer",referenced from:
      objc-class-ref in FirstViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

当我通过可可豆荚安装VLC时,我收到了这个警告:

The `iOSCamApp [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `../Pods/Target Support Files/Pods-iOSCamApp/Pods-iOSCamApp.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag,or
    - Remove the build settings from the target.

当我添加$(继承)标志并尝试构建时,我得到以下崩溃:

Ld /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos/Cameras.app/Cameras normal arm64
    cd /Users/JohnDoe/ios-cam-app/iOSCamApp
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -L/Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos -LLibraries -LLibraries/FFmpeg -LLibraries/kxmovie -LLibraries/MBProgressHUD -LLibraries/Nabto -LLibraries/FFmpeg/include -LLibraries/kxmovie/kxmovie.bundle -LLibraries/Nabto/include -LLibraries/Nabto/lib -LLibraries/FFmpeg/include/libavcodec -LLibraries/FFmpeg/include/libavdevice -LLibraries/FFmpeg/include/libavfilter -LLibraries/FFmpeg/include/libavformat -LLibraries/FFmpeg/include/libavutil -LLibraries/FFmpeg/include/libswresample -LLibraries/FFmpeg/include/libswscale -L/Users/JohnDoe/ios-cam-app/iOSCamApp/Libraries/FFmpeg -L/Users/JohnDoe/ios-cam-app/iOSCamApp/Libraries/Nabto/lib -F/Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos -FFrameworks -F/Users/JohnDoe/ios-cam-app/iOSCamApp -filelist /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Intermediates/iOSCamApp.build/Debug-iphoneos/iOSCamApp.build/Objects-normal/arm64/Cameras.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -lPods-AFNetworking -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -ObjC -lPods-AFNetworking -lbz2 -liconv -lstdc++ -lxml2 -lz -framework AVFoundation -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreText -framework MobileCoreServices -framework MobileVLCKit -framework OpenGLES -framework QuartzCore -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lstdc++.6.0.9 -lc++ -liconv.2.4.0 -lbz2 -lz -framework MediaPlayer -framework CoreAudio -framework Crashlytics -framework AudioToolbox -framework Accelerate -framework OpenGLES -lnabto_static_external -framework CoreVideo -framework CoreMedia -framework CFNetwork -framework AVFoundation -lavutil -lavfilter -lPods -lavdevice -lswscale -lnabto_client_api_static -framework Fabric -lavformat -lswresample -lavcodec -framework QuartzCore -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Intermediates/iOSCamApp.build/Debug-iphoneos/iOSCamApp.build/Objects-normal/arm64/Cameras_dependency_info.dat -o /Users/JohnDoe/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos/Cameras.app/Cameras
ld: framework not found MobileVLCKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有谁知道该怎么办?我尝试了很多东西,似乎没有任何帮助.自动完成能够读取VLC内容并在Xcode中为我自动填充,因此框架应该没问题.

解决方法

Undefined symbols for architecture arm64:

这似乎是个问题.你正在为模拟器进行编译,显然没有为它编译MobileVLCKit. ld是抱怨这个的链接器.你试过在设备上运行吗?

检查您的项目和MobileVLCKit在哪些架构上处于活动状态.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读