VLC Media Kit安装异常及RTSP播放arm64符号未定义问题求助
Hey there, let’s work through this VLC Media Kit issue you’re dealing with—those architecture-specific undefined symbols errors are always frustrating, and the incomplete installation is almost certainly at the root of it. Here’s a step-by-step breakdown to fix things:
1. Reinstall MobileVLCKit Correctly
First, let’s resolve the incomplete installation, since missing framework files are the most common cause of missing symbols:
- If using CocoaPods:
- Delete your
Podfile.lockand the entirePodsdirectory from your project folder. - Run
pod deintegratein your terminal to fully strip out existing pod integrations. - Double-check your Podfile uses the correct pod:
pod 'MobileVLCKit'(note: for iOS, it’s MobileVLCKit, not the desktop VLC Media Kit). - Run
pod install --repo-updateto pull the latest complete version and set everything up properly.
- Delete your
- If installing manually:
- Remove all VLC-related framework files from your project—check both the project navigator and the "Linked Frameworks and Libraries" section under your target’s Build Phases.
- Download the latest official MobileVLCKit framework from the VLC project’s releases.
- Drag the framework into your project, make sure "Copy items if needed" is checked, and confirm it’s added to your target’s linked frameworks list.
2. Tweak Build Settings for Arm64 Compatibility
The arm64-specific error usually comes from mismatched architecture settings or missing linker flags:
- Open your target’s Build Settings:
- Under
Architectures, setArchitecturestoStandard Architectures (arm64, x86_64)(or just arm64 if you’re only targeting physical devices). - For older Xcode versions, check
Valid Architecturesincludes arm64 (this setting is deprecated in newer versions, but still matters for some setups). - Add
-lvlcand-ObjCtoOther Linker Flags—this forces the linker to include all VLC classes and their symbols, which fixes missing class references.
- Under
3. Clean Xcode’s Cache & Rebuild
Xcode’s cached build data often causes weird, unexplained errors. Let’s wipe it out:
- Go to
Product > Clean Build Folder(hold the Option key to see this option if it’s hidden). - Quit Xcode entirely, then delete the
DerivedDatafolder (find it viaXcode > Settings > Locations > DerivedData—click the arrow to open the folder and delete its contents). - Restart Xcode and rebuild your project from scratch.
4. Double-Check Your Import Statements
Make sure you’re importing the VLC framework correctly in StreamDetailVC:
- For Objective-C: Add
#import <MobileVLCKit/MobileVLCKit.h>at the top of your file. - For Swift: Add
import MobileVLCKitat the top of your Swift file.
It’s also worth double-checking for typos in class names, but since the error specifically mentions _OBJC_CLASS_$_VLCMedia, this is almost certainly a linking/installation issue rather than a typo.
内容的提问来源于stack exchange,提问作者Janmejay Parmar

