【问题标题】:cocoapods Google Mobile ads does not generate .xcworkspace filecocoapods 谷歌移动广告不生成 .xcworkspace 文件
【发布时间】:2016-11-14 21:09:41
【问题描述】:

我正在将一个项目从 Unity3d 导出到使用最后一个 GoogleMobileAds 包的 xcode。 我已经安装并更新了 cocoapods,并且还有著名的 podfile,其中包含以下几行:

source 'https://github.com/CocoaPods/Specs.git'
install! 'cocoapods', :integrate_targets => false
platform :ios, ‘8.0’

target ‘MyProject’ do
    pod 'Google-Mobile-Ads-SDK', '~> 7.14’
    pod 'Firebase/Core'
    pod 'Firebase/AdMob'
end

我跑了

pod install

pod update

成功

依赖已经下载好了,如下图所示:

Updating local specs repositories

CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1

Analyzing dependencies
Downloading dependencies
Using Firebase (3.9.0)
Using FirebaseAnalytics (3.5.1)
Using FirebaseCore (3.4.4)
Using FirebaseInstanceID (1.0.8)
Installing Google-Mobile-Ads-SDK (7.14.0)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.0)
Generating Pods project
Skipping User Project Integration
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 8 total pods installed.

根据 cocoapods 和谷歌移动广告文档,我需要继续使用“MyProject.xcworkspace”,但找不到该文件。

有什么建议吗?

【问题讨论】:

  • 阅读此答案stackoverflow.com/a/10960309/7115714 和 cmets
  • Nope... 在我的项目目录中没有出现一个名为 something.xcworkspace 的文件和文件夹...。项目名称也对应于 podfile 中的目标名称。通常应该在运行 pod install 后创建

标签: unity3d admob cocoapods


【解决方案1】:

当使用install! 'cocoapods', :integrate_targets => false 时,Cocoapods 不会为您创建xcworkspace

这是预期的行为。如果您按照命令提示符操作,您甚至会注意到这一点。该行告诉您没有进行集成。

Skipping User Project Integration

如果您想获得xcworkspace,只需删除:integrate_targets => false

【讨论】:

  • 这对我来说是正确的答案,删除:integrate_targets => false,它将生成.xcworkspace。谢谢!
【解决方案2】:

问题似乎来自使用 TextEdit 编辑 Podfile。

当它警告您不应继续使用 TextEdit 时,您可能会错误地认为该程序足够智能,可以理解和纠正这些不需要的修改。 这是我找到的解决方案:

  1. 从您的工作目录中删除 Podfile 和 Podfile.lock
  2. 使用 pod init 创建一个新的 Podfile
  3. 安装 SublimeText 并使用它打开 Podfile
  4. 为项目添加必要的 pod (我还包括了“use_frameworks!”这一行,尽管它可能不是 需要。)
  5. 运行“pod install”和“pod update”;这次我得到了

    [!] 从现在开始,请关闭所有当前 Xcode 会话并为此项目使用 Orbit.xcworkspace

该文件现在在项目目录中可用

【讨论】:

    【解决方案3】:

    您使用this 指导安装 pod?

    【讨论】:

    • 差不多。我还使用了 Google_Mobile_Ads_SDK。
    【解决方案4】:

    除了 Radu Dita 的信息。如果您不希望添加该行(因此您以后不需要删除它),您需要通过选择“无”来禁用“iOS Resolver Settings”中的cocoapods集成,构建项目然后将其重新启用“Xcode Workspace ”。我通过尝试和错误发现了这一点。我希望我的信息能节省别人的时间

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-29
      • 2022-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-28
      • 2021-06-15
      • 2021-06-10
      相关资源
      最近更新 更多