2015-04-17 72 views
5

我一直在努力讓VLC在我的iOS應用中工作一段時間。使用Cocoapods,MobileVLCKit被導入到我的項目中。當我現在運行該應用程序時,它編譯沒有問題。但是,當我包含MobileVLCKit(MobileVLCKit.h,VLCMediaPlayer.h)的任何內容時,應用程序崩潰,告訴我找不到符號。 這是崩潰:讓MobileVLCKit通過Cocoapods工作

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. 

當我加入$(inherited)標誌,並嘗試建立,我得到以下崩潰:

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中爲我自動完成,所以框架應該沒問題。對於建築arm64

回答

0

未定義的符號:

這似乎是這個問題。你正在編譯模擬器,顯然MobileVLCKit沒有編譯。 ld是抱怨這個的鏈接器。你有沒有試過在設備上運行它?

檢查您的項目和MobileVLCKit處於活動狀態的架構。

+1

當我爲一個設備構建它時,我得到了完全相同的消息,除了arm64被更改爲arm7或任何我試圖構建它的設備。 – user1945317