Xcode:无法解析 .. 的调试映射是一个目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36268340/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:40:48  来源:igfitidea点击:

Xcode: Cannot parse the debug map for .. is a directory

iosiphonexcodelinkerios-simulator

提问by SparkyNZ

I'm trying to link my iPhone simulator project and I'm getting the following error at link time:

我正在尝试链接我的 iPhone 模拟器项目,但在链接时出现以下错误:

(null): error: cannot parse the debug map for "/Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks": Is a directory

Here's the linker output:

这是链接器输出:

GenerateDSYMFile /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app.dSYM /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks
    cd /Work/TrainTracks/TrainTracks
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks -o /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app.dSYM

error: cannot parse the debug map for "/Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks": Is a directory

What would cause this problem?

什么会导致这个问题?

I started off with a Game template (Xcode 7.2.1) and deleted the main story board and AppDelegate.* files since this is an SDL cross-platform project.

我从游戏模板 (Xcode 7.2.1) 开始,删除了主故事板和 AppDelegate.* 文件,因为这是一个 SDL 跨平台项目。

采纳答案by SparkyNZ

This problem was caused by a second inclusion of a TrainTracks folder in my project. I already had a yellow TrainTracks group with all of my source but for some reason Xcode was also showing a blue TrackTracks folder as well. This has a duplicate info.plist and other files. I removed the blue folder reference and the project now builds successfully.

这个问题是由我的项目中第二次包含 TrainTracks 文件夹引起的。我已经有一个包含我所有源代码的黄色 TrainTracks 组,但出于某种原因,Xcode 也显示了一个蓝色的 TrackTracks 文件夹。这有一个重复的 info.plist 和其他文件。我删除了蓝色文件夹引用,项目现在成功构建。

回答by llama591

If you are using CocoaPods, and you get this error after changing the name of your Target, click on your target, go to the General tab, scroll down to "Linked Frameworks and Libraries" and then delete the following library:

如果您正在使用 CocoaPods,并且在更改目标名称后出现此错误,请单击您的目标,转到“常规”选项卡,向下滚动到“链接的框架和库”,然后删除以下库:

libPods-YourOldTargetName.a

libPods-YourOldTargetName.a

回答by Tom Andersen

For me this error was the inclusion of the same .m file twice in the project. Happened while moving some files around. Quit Xcode, clean and it told me the file in a linker error.

对我来说,这个错误是在项目中两次包含相同的 .m 文件。移动一些文件时发生。退出 Xcode,清理它并告诉我链接器错误中的文件。

回答by Stefan S

I ran into this problem trying to run my tests, and it was because my test target required the use of one of the pods I had in my Podfile. To fix it I just added my test target to the Podfile and included the relevant pods, as per the following pattern:

我在尝试运行测试时遇到了这个问题,这是因为我的测试目标需要使用我在 Podfile 中的一个 pod。为了修复它,我只是将我的测试目标添加到 Podfile 并包含相关的 pod,按照以下模式:

workspace 'myproject.xcworkspace'
platform :ios, '8.0'

use_frameworks!

def shared_pods
    pod 'RealmSwift', '~> 2.8'
end

project 'myproject.xcodeproj'

target :MyProject do
    project 'myproject.xcodeproj'
    shared_pods
end

target :MyProjectTests do
    project 'myproject.xcodeproj'
    shared_pods
end

回答by nalexn

In my case, this same error showed up because one of the frameworks used in the app was compiled without Bitcode, so I had to turn off Bitcode for the entire project.

在我的例子中,出现同样的错误是因为应用程序中使用的框架之一是在没有 Bitcode 的情况下编译的,所以我不得不为整个项目关闭 Bitcode。

enter image description here

在此处输入图片说明

回答by Geet

In My case I had to delete my entire repository and clone again, nothing else worked, after fresh cloning, I ran a pod install and it worked.

在我的情况下,我不得不删除我的整个存储库并再次克隆,没有其他任何工作,在全新克隆后,我运行了 pod install 并且它工作了。

回答by Gabriel Jensen

In my case, I had made a duplicate of one of my .m files in the finder to keep as reference, and somehow (most likely my error) it was added to the project explorer. The real error was duplicate definitions since the class appeared twice. Removing the "ClassNameHere_copy.m" fixed the issue.

就我而言,我在查找器中复制了我的一个 .m 文件以作为参考,并以某种方式(很可能是我的错误)将其添加到项目资源管理器中。真正的错误是重复定义,因为该类出现了两次。删除“ClassNameHere_copy.m”解决了这个问题。

回答by Will Larche

For me, it was because I changed my target name which made a new cocoa pods .a library but didn't remove the other from linking.

对我来说,这是因为我更改了我的目标名称,它创建了一个新的可可豆荚 .a 库,但没有从链接中删除另一个。