Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of unresolved identifier 'FirebaseApp', only while creating a build

I am trying to use Firebase for Analytics but when I add FirebaseApp.configure() in didFinishLaunchingWithOptions in AppDelegate.

The Xcode gives Use of unresolved identifier 'FirebaseApp'.

Strangely, if I build the code in simulator, it installs, but the error is generated only when I try to archive with Generic iOS device.

To solve this I tried replacing it with FireApp.configure() which can create the build but crashes when installed through TestFlight.

The deployment version in 10.0 for the app and Swift Version is 4.

It is compatible with latest version of Cocoapods.

Tried to replace FirebaseApp.configure() with FireApp.configure()

Use of unresolved identifier 'FirebaseApp'

Podfile is as follows

workspace 'Main.xcworkspace'
platform :ios, '10.0'
use_frameworks!

project 'A'
project 'B'
project 'C'
project 'D'

def common_pods
    pod 'Whisper', '~> 5.1.0'
    pod 'Gifu', '~> 2.0'
    pod 'Alamofire', '~> 4.0'
    pod 'SwiftyJSON'
    pod 'UIColor_Hex_Swift', '~> 3.0.2'
    pod 'DKImagePickerController', '~> 4.0.4'
    pod 'ReachabilitySwift', '~> 3'
    pod 'HueKit'
    pod 'HanekeSwift', :git => 'https://github.com/Haneke/HanekeSwift.git'
    pod 'PKHUD', '~> 4.0'
    pod 'MZFormSheetPresentationController'
    pod 'Spring', :git => 'https://github.com/MengTo/Spring.git', :branch => 'swift4'
    pod 'Locksmith'
    pod 'Google/SignIn'
    pod 'DeviceKit', '~> 1.0'
    pod 'Amplitude-iOS', '~> 3.7.0'
    pod 'Firebase'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'Firebase/Analytics'
    pod 'TOCropViewController'
    pod 'Hero'
    pod 'Socket.IO-Client-Swift', '~> 14.0.0'
    pod 'NewPopMenu', '~> 2.0'
    pod "QRCode"
    pod 'VVCircleProgressBar'
    pod 'PMAlertController'
    pod 'SwiftMessages', :git => 'https://github.com/SwiftKickMobile/SwiftMessages', :commit => '2e4381b61648a0451a7852b57bb0b4a82a4e6ce2'
    pod 'MaterialShowcase'  
end

target 'C' do
    project 'C/C.xcodeproj'
    pod 'Alamofire', '~> 4.0'
    pod 'SwiftyJSON'
    pod 'Locksmith'
end

target 'B' do
    project 'B/B.xcodeproj'
    pod 'SwiftyJSON'
    pod 'Gifu', '~> 2.0'
    pod 'UIColor_Hex_Swift', '~> 3.0.2'
    pod 'DKImagePickerController', '~> 4.0.4'
    pod 'ReachabilitySwift', '~> 3'
    pod 'HanekeSwift', :git => 'https://github.com/Haneke/HanekeSwift.git'
    pod 'PKHUD', '~> 4.0'
    pod 'MZFormSheetPresentationController'
    pod 'DeviceKit', '~> 1.0'
    pod 'Amplitude-iOS', '~> 3.7.0'
    pod 'Spring', :git => 'https://github.com/MengTo/Spring.git', :branch => 'swift4'
    pod 'TOCropViewController'
    pod 'Alamofire', '~> 4.0'
    pod 'Whisper', '~> 5.1.0'
end

target 'Main' do
    project 'Main.xcodeproj'
    common_pods
end

target 'D' do
    project 'D/D.xcodeproj'
    common_pods
end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '4.0'
      config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
    end
  end
end
like image 656
user12108504 Avatar asked Sep 23 '19 16:09

user12108504


1 Answers

I added import FirebaseCore then the issue has resolved

like image 137
Sourabh Kumbhar Avatar answered Nov 17 '22 12:11

Sourabh Kumbhar