简体   繁体   中英

iOS Swift - No module such as Firebase

This is my podfile:

 # Uncomment this line to define a global platform for your project
platform :ios, '8.0'

target 'Grabit' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Grabit
  pod 'Firebase','>= 2.5.0'

I tried:

  1. Correct podfile like above.
  2. Open project by terminal
  3. Clean and rebuild project.

I tried it many times but I still get the error:

no module such as Firebase

These are my version of Firebase:

  • Installing Firebase 3.5.2 (was 3.5.2)
  • Using FirebaseAnalytics (3.3.1)
  • Using FirebaseInstanceID (1.0.8)

Any help is appreciated.

Things to check when getting this message:

no module such as Firebase

  1. Does your Podfile file have use frameworks! ? should look something like

     use_frameworks! target 'Project' do pod 'Firebase' pod 'Firebase/Auth' pod 'Firebase/Core' pod 'Firebase/Database' end target 'Project' do pod 'Firebase' pod 'Firebase/Auth' pod 'Firebase/Core' pod 'Firebase/Database' end 
    • Notice that if you want the latest version of a pod, you don't need to specify the version
  2. Do you open your project with MyProject.xcworkspace (white icon) file and not with MyProject.xcodeproj (blue icon)?
  3. Close Xcode and run pod install or pod update . Then open the MyProject.xcworkspace and build the project

Try Cleaning up the Project. So far this works for me. Also I notice you're missing the "end"

target 'yourProjectname' do
platform :ios, '9.3'
use_frameworks!
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end

This is working perfectly for me:

use_frameworks!

target 'Project' do
  pod 'Firebase'
  pod 'Firebase/Auth'
  pod 'Firebase/Core'
  pod 'Firebase/Database'
end

You don't need to set the version, by using just the name, you'll always get the latest version.

In Termin do pod install , then pod update .

Then completely clean your project with [CMD]+[ALT]+[SHIFT]+[K] .

Then clean with [CMD]+[SHIFT]+[K] .

Then close Xcode, start MyProject.xcworkspace (white icon) and build.

删除派生数据,尝试清理项目然后构建,它将工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM