问题描述
其他与Firebase无关的项目use_frameworks!
target'myapp'do
pod'Firebase / Core'
#
end
导致此错误:
callstack包含来自其他框架的编译类。
Swift 3,XCode 8。
没有这个pod(FireBase),我的项目工作正常。
这个问题是关于 -ObjC
标志的。 CocoaPods将此标志自动添加到其他链接标志
项目中。但是,这个标志我的其他自定义项目没有构建正常。 为了解决这个问题,我做了这些步骤。
- 我已经下载了没有CocoaPods集成的文件。
- 按照 Readme.md 中的描述,将多个工厂拖放到文件中:
FirebaseAnalytics.framework
,FirebaseCore.framework
,FirebaseInstanceID.framework
,GoogleInterchangeUtilities.framework
,GoogleSymbolUtilities.framework
,GoogleToolboxForMac.framework
以及admob:GoogleMobileAds.framework -ObjC
flat,强制使用所有我已经更改过的库 - >其他链接标志使用
-force_load
。也就是说,-force_load GoogleMobileAds.framework / GoogleMobileAds -force_load FirebaseAnalytics.framework / FirebaseAnalytics -force_load FirebaseCore.framework / FirebaseCore -force_load GoogleToolboxForMac.framework / GoogleToolboxForMac -force_load GoogleSymbolUtilities.framework / GoogleSymbolUtilities -force_load GoogleInterchangeUtilities.framework / GoogleInterchangeUtilities -force_load FirebaseInstanceID.framework / FirebaseInstanceID
不要忘记创建并下载 GoogleService-控制台内的Info.plist 文件:
**编辑**
版本3.12拒绝 -force_load GoogleSymbolUtilities.framework / GoogleSymbolUtilities
所以,现在正确的解决方案是:
code> -force_load GoogleMobileAds.framework / GoogleMobileAds -force_load FirebaseAnalytics.f ramework / FirebaseAnalytics -force_load FirebaseCore.framework / FirebaseCore -force_load GoogleToolboxForMac.framework / GoogleToolboxForMac -force_load GoogleInterchangeUtilities.framework / GoogleInterchangeUtilities -force_load FirebaseInstanceID.framework / FirebaseInstanceID
target 'myapp' do
pod 'Firebase/Core'
#the other projects not related with Firebase
use_frameworks!
end
leads to this error:
the callstack consists of compiled classes from the other frameworks.
Swift 3 , XCode 8.
Without this pod (FireBase) my project works correctly.
The problem was about -ObjC
flag. CocoaPods added this flag into Other linker flags
project automatically.
But this this flag my other custom projects did not build properly.In order to fix this I did these steps.
- https://firebase.google.com/docs/ios/setup I've dowloaded file under Integrate without CocoaPods .
- Dragged several franeworks into file as described at Readme.md :
FirebaseAnalytics.framework
,FirebaseCore.framework
,FirebaseInstanceID.framework
,GoogleInterchangeUtilities.framework
,GoogleSymbolUtilities.framework
,GoogleToolboxForMac.framework
and for admob:GoogleMobileAds.framework
- In order to prevent
-ObjC
flat that force use all libraries I've changedOther linker flag
using-force_load
. That is,-force_load GoogleMobileAds.framework/GoogleMobileAds -force_load FirebaseAnalytics.framework/FirebaseAnalytics -force_load FirebaseCore.framework/FirebaseCore -force_load GoogleToolboxForMac.framework/GoogleToolboxForMac -force_load GoogleSymbolUtilities.framework/GoogleSymbolUtilities -force_load GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities -force_load FirebaseInstanceID.framework/FirebaseInstanceID
Do not forget to create and download GoogleService-Info.plist file inside console:https://console.firebase.google.com
** EDIT **
Version 3.12 rejects -force_load GoogleSymbolUtilities.framework/GoogleSymbolUtilities
So , now correct solution is:
-force_load GoogleMobileAds.framework/GoogleMobileAds -force_load FirebaseAnalytics.framework/FirebaseAnalytics -force_load FirebaseCore.framework/FirebaseCore -force_load GoogleToolboxForMac.framework/GoogleToolboxForMac -force_load GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities -force_load FirebaseInstanceID.framework/FirebaseInstanceID
这篇关于使用FireBase + CocoaPods的Google广告出现错误:“architechture x86_64的重复符号”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!