Luong Dinh Luong Dinh - 3 months ago 16
Swift Question

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.

Answer

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.