求助:引入FirebaseUI模块失败,继承FirebaseAppDelegate报错
Fixing the "No such module 'FirebaseUI'" Error
Hey there, let's work through that frustrating "No such module 'FirebaseUI'" error you're seeing when trying to inherit from FirebaseAppDelegate. This issue almost always boils down to installation or configuration gaps—here's how to troubleshoot it:
1. Verify FirebaseUI is properly installed
If using CocoaPods:
- Double-check your
Podfileincludes the FirebaseUI dependency. Depending on your needs, it might look like this:pod 'FirebaseUI' # Or specify a submodule if you only need specific features, e.g.: # pod 'FirebaseUI/Auth' - Run
pod installin your project directory, then make sure you open the.xcworkspacefile (not the old.xcodeproj)—this is a super common mistake!
If installing manually:
- Confirm you've added all FirebaseUI framework files to your project.
- Check that the FirebaseUI frameworks are listed in your target's Build Phases > Link Binary With Libraries section.
2. Tweak your project's Build Settings
- Head to your target's Build Settings and look for
Framework Search Paths. Ensure it includes paths pointing to where FirebaseUI is located. For CocoaPods users, adding$(inherited)and$(PROJECT_DIR)/Podsshould cover it. - Make sure
Enable Modules (C and Objective-C)is set toYES—this lets Xcode properly recognize Swift modules like FirebaseUI.
3. Clean and rebuild your project
- Hit
Cmd + Shift + Kto clean your project's build artifacts. - Rebuild with
Cmd + B, and if that doesn't work, try restarting Xcode entirely—sometimes Xcode holds onto old cache that causes module issues.
4. Check version compatibility
The documentation you're referencing is for FirebaseUI 0.3.2, which is pretty outdated. Newer versions of Swift or Firebase might not play nice with this old release. Make sure you're using a FirebaseUI version that's compatible with your Swift and Firebase SDK versions.
For reference, here's how your code should look once the module issue is fixed:
import UIKit import FirebaseUI @UIApplicationMain class AppDelegate: FirebaseAppDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Your initialization code here return true } }
内容的提问来源于stack exchange,提问作者xdeleon
相关产品推荐
相关产品推荐

