objective-c - 尚未创建 Firebase Analytics。 ld : warning: Some object files have incompatible Objective-C category definitions

标签 objective-c firebase swift3 firebase-analytics xcode8.2

ld: warning: Some object files have incompatible Objective-C category definitions. Some category metadata may be lost. All files containing Objective-C categories should be built using the same compiler.

当我通过 cocopods 安装 Firebase/Core 时,出现了上面的警告。而且我认为它会导致错误,因为我的项目无法读取我项目中 App deleagate 的 FIRApp.configure()。我确定我下载了 GoogleService-Infor.plist 并将其放在项目中的正确位置,因为我之前在我的另一个项目上完成过(正常工作),我的另一个项目没有 Objective-C 类别警告。

谁能帮帮我?

我做过的过程:

  1. 在项目 podfile 中添加 pod 'Firebase/Core',关闭 xcode。
  2. 打开终端,进入目标项目文件夹,执行pod install

    enter image description here

  3. 在终端出现一个警告(解决办法:把$(inherited)放在ALWAYS_...的build设置中,然后问题解决) [!] xxxxxx-ebooking [Debug] 目标覆盖了 `Pods/Target Support Files/Pods-xxxxxx-ebooking/Pods-xxxxx-ebooking 中定义的 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build设置.debug.xcconfig'。这可能会导致 CocoaPods 安装出现问题:

    • 使用$(inherited)标志,或者
    • 从目标中删除build设置。
  4. 在xcode上出现一个warning(这个问题很简单,提交新文件然后warning就消失了):

    file:///Users/yyyyyy/Projects/xxxxxx_projects/xxxxxx-ebooking/Pods/Target%20Support%20Files/Pods-xxxxxx-ebooking/Pods-xxxxxx-ebooking.debug.xcconfig: warning: Missing file: /Users/yyyyyy/Projects/xxxxxx_projects/xxxxxx-ebooking/Pods/Target Support Files/Pods-xxxxxx-ebooking/Pods-xxxxxx-ebooking.debug.xcconfig is missing from working copy

  5. 忽略3、4的issues流程,因为很容易解决。因为最有线的警告是:

    ld: warning: Some object files have incompatible Objective-C category definitions. Some category metadata may be lost. All files containing Objective-C categories should be built using the same compiler.

  6. Firebase Analytics 尚未创建。请通过调用 [FIRApp configure] 配置 Firebase

    我确实将 FIRApp.configure() 放入了我的项目中。但是当我在某些 View 上调用 FA 事件时确实加载了,它会显示此警告。我相信这是因为 Objective-C 警告。

最佳答案

看看在静态变量上使用 @nonobjc 是否可以解决问题

关于objective-c - 尚未创建 Firebase Analytics。 ld : warning: Some object files have incompatible Objective-C category definitions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41799619/

相关文章:

android - Algolia 和 firestore 价格 + 评论

ios - 无法转换类型的值(NSSingleEntryDictionary)

ios - 有没有办法从 StoreKit API 中的 SKPayment 获取 SKProduct?

ios - UIViewContentModeScaleAspectFill 扩展 UIView 的框架

iphone - iOS : formatting decimal numbers

facebook-graph-api - firebase + facebook 开放图谱

objective-c - ipatool 失败,出现异常 : Xcode 10. 1

firebase - Flutter firebase sendSignInLinkToEmail 不发送电子邮件并报告任何错误 iOS

ios - swift3 scrollToRow 即使有空单元格

arrays - 在 View Controller 之间传递数组