【问题标题】:Cannot debug in Xcode: Debug info from this module will be unavailable in the debugger无法在 Xcode 中调试:来自此模块的调试信息在调试器中将不可用
【发布时间】:2018-03-22 08:30:18
【问题描述】:

添加 Firebase 后无法在 Xcode 中进行调试。

您无法使用 expr 执行命令,并且没有可查看的变量信息。

Firebase 使用以下方向在没有 Cocoapods 的情况下集成:https://firebase.google.com/docs/ios/setup#frameworks

这是 Xcode 在尝试使用 expr 执行命令后显示的内容:

warning: Swift error in module Test.
Debug info from this module will be unavailable in the debugger.

error: in auto-import:
failed to get module 'Test' from AST context:
error: missing required module 'Firebase'

我们正在使用 Swift 3。

【问题讨论】:

  • 你也可以添加你的pod文件代码吗?
  • 我们没有通过 cocoapods @SatishBabariya 安装

标签: ios swift xcode debugging firebase


【解决方案1】:

这是 Xcode 的一个错误。我面临同样的问题。经过一些研究,我发现这是因为代码不好,特别是当你使用闭包时。它被报告为 xcode 错误,但有一些方法可以修复它。使用 print("") 进行调试。

【讨论】:

    【解决方案2】:

    我在使用 XCode 9 时遇到了同样的问题。我花了 2 个小时寻找解决方案,然后有人建议我,我应该在 XCode 10 上运行我的代码(我仍在使用 XCode beta)。它起作用了?。

    希望对您有所帮助!!。

    【讨论】:

      【解决方案3】:

      问题在于没有使用包含 module.modulemap 的目录更新 User Header Search Paths

      以下是手动安装的说明,不小心被忽略了:

      如果您使用的是 Swift,或者您想使用模块,请将 module.modulemap 进入您的项目并更新您的用户标题 搜索路径以包含包含您的模块的目录 地图。

      另一个问题是识别正确的目录路径,因为我们使用组来组织文件,而不是文件夹。

      愿别人从我们的愚蠢中受益! :)

      【讨论】:

        【解决方案4】:

        您必须将 Firebase 等模块添加到您的 podfile 中的测试方案中

        Cocoapods

        source 'https://github.com/CocoaPods/Specs.git'
        # Uncomment the next line to define a global platform for your project
         platform :ios, '10.0'
        
        target 'yourApp' do
          # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
          use_frameworks!
        
          # Pods for yourApp
          pod 'Alamofire', '4.4.0'
          pod 'Firebase', '4.3.0'
        
          target 'yourAppTests' do
            inherit! :search_paths
            # Pods for testing
            pod 'Firebase', '4.3.0'
          end
        
        end
        

        手动添加

        (我不能 100% 确定这是否有效)

        1. 在 Xcode 中单击 Projekt(项目中的第一个列表点)
        2. 在 Targets 处选择您的测试目标 (yourAppTests)
        3. 在“构建设置”中搜索“其他链接”
        4. 添加到“其他链接器标志”
          1. -ObjC
          2. -框架
          3. “GoogleToolboxForMac”
          4. -框架
          5. “纳米”

        【讨论】:

        • 我们没有通过 cocoapods 安装。
        • 哦,好吧 x) 而不是确保该库也“连接”到您的测试方案
        • 这取决于你如何安装库
        • 我们在此处遵循了 Firebase“无需可可豆荚进行集成”的说明:firebase.google.com/docs/ios/setup#frameworks
        猜你喜欢
        • 2017-11-01
        • 2012-03-03
        • 1970-01-01
        • 1970-01-01
        • 2015-03-10
        • 1970-01-01
        • 2017-05-19
        • 1970-01-01
        相关资源
        最近更新 更多