''Pods'目标具有传递依赖性,包括安装'Google-Maps-iOS-Utils'时的静态二进制文件'

问题描述:

我试图安装'Google-Maps-iOS-Utils',但它给了我上面的错误。 这里是Podfile:''Pods'目标具有传递依赖性,包括安装'Google-Maps-iOS-Utils'时的静态二进制文件'

platform :ios, '9.0' 
use_frameworks! 
target 'MapClusters' do 
    pod 'Alamofire' 
    pod 'SwiftyJSON' 
    pod 'GoogleMaps' 
    pod 'Google-Maps-iOS-Utils' 
end 

我试图删除pod 'Google-Maps-iOS-Utils'和它的工作。所以我猜Google-Maps-iOS-Utils是导致问题的原因之一。这里是完整的错误:

[!] The 'Pods-MapClusters' target has transitive dependencies that include static binaries: (/Users/BAPS/Documents/Test/MapClusters/Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework, /Users/BAPS/Documents/Test/MapClusters/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMapsCore.framework, and /Users/BAPS/Documents/Test/MapClusters/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMaps.framework) 

我已经在这里或其他地方在网络上经历了很多答案。 直到现在我尝试了这些解决方案:

  1. 禁用的传递依赖检查。

    2. pre_install do |installer| def installer.verify_no_static_framework_transitive_dependencies; end end

    post_install do |installer| find Pods -regex 'Pods/GoogleMaps.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)GoogleMaps\\/\\(.*\\)\\(>\\)/\\"\\2\\"/' find Pods -regex 'Pods/Google-Maps-iOS-Utils.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)Google-Maps-iOS-Utils\\/\\(.*\\)\\(>\\)/\\"\\2\\"/' end

在Podfile,安装工程将以上两点之后,但后来当我尝试运行应用程序,我得到这个错误:

Error

删除pod 'SwiftyJSON'后i吨工作,但我需要在那里。

我也尝试了其他一些东西,但似乎没有帮助。我是ios开发新手,所以我无法帮助自己。

我使用的是swift,xcode 7.3和最新的cocoapods。

+0

通过扩展是否存在'GoogleMaps.h'文件来检查您的框架。使用所有头文件正确添加框架。 –

+0

@DipenPanchasara我无法弄清楚。我在哪里必须看。如果它不存在,那我该如何添加它? –

+0

我很忙,给我一些时间,我会明天看一看。 –

经过很多努力,我已经想通了。根据要求谷歌家伙已经把他们的git存储库的教程。 Here is the link

请更新您的POD文件

platform :ios, '9.0' 
use_frameworks! 
target 'MapClusters' do 
    pod 'Alamofire' 
    pod 'SwiftyJSON' 
    pod 'GoogleMaps' 
    pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/googlemaps/google-maps-ios-utils' 
end 
+3

我已经试过了。这没有用。 –

使用此代码podfile避免错误而吊舱安装:

pre_install do |installer| 
    def installer.verify_no_static_framework_transitive_dependencies; end 
end 

但仍需要荚LIB解决方案。

+1

太好了,谢谢。 – RaziPour1993