使用Cocoapods 0.37,Swift框架无法找到GoogleAnalytics-iOS-SDK的标头 [英] Can't find headers for GoogleAnalytics-iOS-SDK with Cocoapods 0.37, Swift, frameworks

查看:94
本文介绍了使用Cocoapods 0.37,Swift框架无法找到GoogleAnalytics-iOS-SDK的标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Swift项目中使用cocoa pods 0.37.0,使用use_frameworks!设置在podfile中,我无法访问GoogleAnalytics-iOS-SDK窗格的头文件。



如何访问应用中的Google Analytics窗格标题?



我试过了;

  import GoogleAnalytics_iOS_SDK 

在Swift文件中,cocoapods 0.36风格。但是没有框架创建,所以没有用。

  #import< GoogleAnalytics_iOS_SDK / GAI.h> 

在桥接标题中,但不起作用(无模块映射?)






我已经读过,在cocoapods中只改变了'sourse_files'头文件中的标题行为0.37 (见这个提交)。这似乎是对0.36 (看到这个问题)



通过Cocoapod行为的这种改变,静态库被正确集成(它不是0.36) ,符号被编译到应用程序中并在运行时可用。但我无法访问标题。

解决方案

这是Cocoapods 0.37.0中的一个错误。已将其作为问题#3499 登录到其跟踪器中。



解决方法


  • 添加 $(SRCROOT)/ Pods / GoogleAnalytics-iOS在应用程序目标的构建设置中设置< - c $ c>到用户头部搜索路径(设置为递归)

  • 使用 #importGAI.h
  • 直接在Bridging标头中引用Google Analytics标头b $ b

Using cocoa pods 0.37.0 in a Swift project, with use_frameworks! set in the podfile, I am unable to access the header files for the GoogleAnalytics-iOS-SDK pod.

How should I access the Google Analytics pod's headers in my app?

I have tried;

import GoogleAnalytics_iOS_SDK

In a Swift file, cocoapods 0.36 style. But there's no framework created anymore so no good.

#import <GoogleAnalytics_iOS_SDK/GAI.h>

In the bridging header, but doesn't work (no module map ?)


I have read that the behaviour for pods that only include headers in their 'sourse_files' changed in cocoapods 0.37 (see this commit). This appears to be in response to the problems that use_frameworks caused with these pods in 0.36 (see this SO question).

With this change in Cocoapod behaviour, the static library is integrated correctly (it wasn't with 0.36), the symbols are compiled into the app and available at runtime. But I don't have access to the headers.

解决方案

This is a bug in Cocoapods 0.37.0. It has been logged in their tracker as issue #3499.

Workaround

  • Add $(SRCROOT)/Pods/GoogleAnalytics-iOS-SDK to the User Header Search Paths (set to Recursive) in the app target's Build Settings.
  • Reference the Google Analytics header directly in the Bridging Header with #import "GAI.h"

这篇关于使用Cocoapods 0.37,Swift框架无法找到GoogleAnalytics-iOS-SDK的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆