Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 使用未解析标识符';FirebaseApp';,仅在创建生成时_Swift_Xcode_Firebase - Fatal编程技术网

Swift 使用未解析标识符';FirebaseApp';,仅在创建生成时

Swift 使用未解析标识符';FirebaseApp';,仅在创建生成时,swift,xcode,firebase,Swift,Xcode,Firebase,我正在尝试使用Firebase进行分析,但当我在AppDelegate中的didFinishLaunchingWithOptions中添加FirebaseApp.configure()时 Xcode使用未解析的标识符“FirebaseApp” 奇怪的是,如果我在模拟器中构建代码,它会安装,但只有在我尝试使用通用iOS设备存档时才会生成错误 为了解决这个问题,我尝试用FireApp.configure()替换它,它可以创建构建,但在通过TestFlight安装时崩溃 10.0版本中应用程序和Swi

我正在尝试使用Firebase进行分析,但当我在AppDelegate中的didFinishLaunchingWithOptions中添加FirebaseApp.configure()

Xcode使用未解析的标识符“FirebaseApp”

奇怪的是,如果我在模拟器中构建代码,它会安装,但只有在我尝试使用通用iOS设备存档时才会生成错误

为了解决这个问题,我尝试用FireApp.configure()替换它,它可以创建构建,但在通过TestFlight安装时崩溃

10.0版本中应用程序和Swift版本的部署版本为4

它与最新版本的Cocoapods兼容

试图用FireApp.configure()替换FirebaseApp.configure()

使用未解析标识符“FirebaseApp

文件如下

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

您正在将Firebase导入到您的类中吗?尝试导入Firebase


因为你有很多目标,可能与他们有关。您正在归档哪些目标?

我在主项目中添加了Firebase pod。

我添加了
导入FirebaseCore
然后问题已经解决

您可以共享您的pod文件吗?使用pod文件进行编辑,如果我在模拟器中构建代码,它会安装,但是,只有当我尝试使用通用iOS设备进行归档时,才会生成错误。如果Firebase未导入,调用
FirebaseApp.configure()
将引发错误我正在存档主目标太棒了!真烦人