Using cocoapods to implement VLC

iOS, iPad, iPhone, tvOS specific usage questions
Fiddlesnarf7
New Cone
New Cone
Posts: 2
Joined: 17 Apr 2015 14:07

Using cocoapods to implement VLC

Postby Fiddlesnarf7 » 17 Apr 2015 14:38

Hey all,

I've been struggling to get VLC working in my iOS app for a while now. Using Cocoapods, the MobileVLCKit is imported into my project. When I run the app now, it compiles with no problem. However, when I include anything from the MobileVLCKit (MobileVLCKit.h, VLCMediaPlayer.h), the app crashes, telling me that symbols aren't found.
This is the crash:

Code: Select all

Ld /Users/gerdjanvanhagen/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos/Cameras.app/Cameras normal arm64 cd /Users/gerdjanvanhagen/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/gerdjanvanhagen/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/gerdjanvanhagen/ios-cam-app/iOSCamApp/Libraries/FFmpeg -L/Users/gerdjanvanhagen/ios-cam-app/iOSCamApp/Libraries/Nabto/lib -F/Users/gerdjanvanhagen/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos -FFrameworks -F/Users/gerdjanvanhagen/ios-cam-app/iOSCamApp -filelist /Users/gerdjanvanhagen/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/gerdjanvanhagen/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Intermediates/iOSCamApp.build/Debug-iphoneos/iOSCamApp.build/Objects-normal/arm64/Cameras_dependency_info.dat -o /Users/gerdjanvanhagen/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)
When I installed VLC through cocoa pods, I got this warning:

Code: Select all

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.
When I add the $(inherited) flag and try to build, I get the following crash:

Code: Select all

Ld /Users/gerdjanvanhagen/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos/Cameras.app/Cameras normal arm64 cd /Users/gerdjanvanhagen/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/gerdjanvanhagen/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/gerdjanvanhagen/ios-cam-app/iOSCamApp/Libraries/FFmpeg -L/Users/gerdjanvanhagen/ios-cam-app/iOSCamApp/Libraries/Nabto/lib -F/Users/gerdjanvanhagen/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Products/Debug-iphoneos -FFrameworks -F/Users/gerdjanvanhagen/ios-cam-app/iOSCamApp -filelist /Users/gerdjanvanhagen/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/gerdjanvanhagen/Library/Developer/Xcode/DerivedData/iOSCamApp-cnnuesgeqommwvbqtarspgwsjgbn/Build/Intermediates/iOSCamApp.build/Debug-iphoneos/iOSCamApp.build/Objects-normal/arm64/Cameras_dependency_info.dat -o /Users/gerdjanvanhagen/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)
Does anyone know what to do? I've tried so many things and nothing seems to help. Auto complete is able to read the VLC stuff and autocompletes it for me in Xcode, so the framework should be fine

Fiddlesnarf7
New Cone
New Cone
Posts: 2
Joined: 17 Apr 2015 14:07

Re: Using cocoapods to implement VLC

Postby Fiddlesnarf7 » 20 Apr 2015 10:05

If anyone else coming from Google for example has the same issue, please post here to raise awareness

vampirewalk
New Cone
New Cone
Posts: 3
Joined: 23 Apr 2015 12:21

Re: Using cocoapods to implement VLC

Postby vampirewalk » 23 Apr 2015 12:28

Try changing your implementation file extension from ".m" to ".mm".

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Using cocoapods to implement VLC

Postby fkuehne » 23 Apr 2015 16:56

Make sure that the MobileVLCKit static library is actually in your linker path, which does not appear to be the case.

Further, note that the app technically does not crash. It gives you a linking error because the linker can't find the symbols you are referencing.

Further nit-picking: it is absolutely not a wise idea to link both against KXMovie with all of its dependencies like FFmpeg as the same libraries are also part of MobileVLCKit and you are bound to run into versioning conflicts as chances are very small that MVK and KWMovie are using the same version of said software. In fact, MVK is not even guaranteed to use FFmpeg, it could be switch to libav in any version or back and forth.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

locomunkey
New Cone
New Cone
Posts: 3
Joined: 06 Mar 2017 09:17

Re: Using cocoapods to implement VLC

Postby locomunkey » 06 Mar 2017 11:17

I solved this by giving MobileVLCKit.framework in Pods/MobileVLCKit/Frameworks target membership in the "Tests" target.


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 8 guests