Xcode 10 测试版中的 Google Fabric
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51869770/
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
Google Fabric in Xcode 10 beta
提问by RubberDucky4444
I installed Xcode 10 Beta 6 and I am updating everything and in this process I have run into a small issue with Fabric. Fabric's website has special instructions for Xcode 10 that says:
我安装了 Xcode 10 Beta 6 并且正在更新所有内容,在此过程中我遇到了 Fabric 的一个小问题。Fabric 的网站上有专门针对 Xcode 10 的说明,内容是:
When I am in Xcode 10 I go to Build Phases an on the Run Script that has my Fabric key there is a + sign under the section Input Fields
当我在 Xcode 10 中时,我转到具有我的 Fabric 密钥的运行脚本上的构建阶段,该部分下有一个 + 号 Input Fields
When I click the + it automatically generates $(SRCROOT)/newInputFile
where newInputFile
is automatically highlighted.
当我点击+,它会自动生成$(SRCROOT)/newInputFile
,其中newInputFile
自动高亮显示。
I'm not understanding Fabric's instructions. Do I copy the $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
after $(SRCROOT)/
Do I replace INFOPLIST_PATH with the file path to my info.plist?
我不明白 Fabric 的说明。我是否复制$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
之后$(SRCROOT)/
是否将 INFOPLIST_PATH 替换为我的 info.plist 的文件路径?
I've tried all these options but Fabric is still crashing in Xcode 10. I know it is Fabric because I've commented out Fabric.with([Crashlytics.self])
in my App Delegate's didFinishLaunchingWithOptions
我已经尝试了所有这些选项,但 Fabric 仍然在 Xcode 10 中崩溃。我知道它是 Fabric,因为我已经Fabric.with([Crashlytics.self])
在我的 App Delegate 中注释掉了didFinishLaunchingWithOptions
采纳答案by Danilo Gomes
I did exactly what was recommend by Mahdi RB. Also followed the steps on official manual guide, didn't work.
我完全按照 Mahdi RB 的建议做了。也按照官方手册指南的步骤操作,没有用。
When I build using XCode I see it processes about 2k tasks. The fabric builds usually works when I start the machine, open xcode and execute archive. After that the build starts to break most of the time. I'm using the latest fabric & crashlytics downloaded on 03/OCT/18. It's really weird as it works for my other projects, it's just this one that fails. This started with XCode 10 - Version 10.0 (10A255). It was working with previous XCode 9.
当我使用 XCode 构建时,我看到它处理了大约 2k 个任务。结构构建通常在我启动机器、打开 xcode 并执行存档时工作。在那之后,构建开始在大部分时间中断。我正在使用 18 年 3 月 3 日下载的最新 Fabric 和 crashlytics。这真的很奇怪,因为它适用于我的其他项目,只有这个项目失败了。这始于 XCode 10 - 版本 10.0 (10A255)。它适用于以前的 XCode 9。
This is some proof of what I'm talking:
这是我在说什么的一些证据:
My workaround was to add this command before calling the fabric command. E.g
我的解决方法是在调用结构命令之前添加此命令。例如
sleep 15
"${PROJECT_DIR}/Fabric.framework/run" aaaaa aaaa
I noticed on my mac console app loads of this error, not sure if it's related:
我注意到我的 mac 控制台应用程序加载了这个错误,不确定它是否相关:
IBAgent-iOS - assertion failed - libxpc.dylib - and some numbers here.
Error on XCode
XCode 上的错误
2018-10-03 13:53:58.698 uploadDSYM[46168:550157] Fabric.framework/run 1.7.2 (210)
2018-10-03 13:53:58.704 uploadDSYM[46168:550157] Using API Key: "123"
2018-10-03 13:53:58.704 uploadDSYM[46168:550157] Launched uploader in validation mode
error: Fabric: Info.plist Error
Unable to process Info.plist at path /Users/someuser/Library/Developer/Xcode/DerivedData/SampleApp-amwweapikvrbgafmmnyeyorkiufq/Build/Intermediates.noindex/ArchiveIntermediates/SampleApp/BuildProductsPath/Release-iphoneos/SampleApp.app/Info.plist
This could be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved Inspector.app from the location Xcode generated it. You can also add '$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)' as an "Input Files" dependency for your Fabric run script build phase.
I tried to open that plist link, it points to a shortcut, and that shortcut points to a real file. Not sure why that is failing. My guess it has something to do with files not being present at the time the script is executed. The delay fixes the issue. I hope this can help.
我试图打开那个 plist 链接,它指向一个快捷方式,而该快捷方式指向一个真实的文件。不知道为什么会失败。我猜这与执行脚本时文件不存在有关。延迟解决了这个问题。我希望这会有所帮助。
- I removed the original app names for privacy.
- 出于隐私考虑,我删除了原始应用程序名称。
回答by Hardik Thakkar
For Xcode 10 only, user's who face issue in final setup of fabric is your project.
仅适用于 Xcode 10,在结构的最终设置中遇到问题的用户是您的项目。
From Xcode 10 you need to make one more setup in Build Phase's Input Files field.
从 Xcode 10 开始,您需要在Build Phase 的 Input Files 字段中再进行一项设置。
Simply You need to copy this $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)and paste to Build Phase's Input Files field under Run Scriptas display in below image.
只需复制此$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)并粘贴到Run Script 下的 Build Phase 的 Input Files 字段,如下图所示。
Read more on this link : https://fabric.io/kits/ios/crashlytics/install
在此链接上阅读更多信息:https: //fabric.io/kits/ios/crashlytics/install
回答by Mahdi RB
I had same problem, if your info.plist is in your root directory like this:
我有同样的问题,如果你的 info.plist 像这样在你的根目录中:
yo should change $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
like this:
你应该$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
像这样改变:
回答by user10375102
fabric info.plist error can be solved by changing the Xcode workspace settings-->build settings--> legacy build system
可以通过更改Xcode工作区设置-->构建设置-->遗留构建系统来解决fabric info.plist错误
回答by Savas Adar
回答by Demetri Kulakoff
I solved this issue by moving the "Run Script" to the bottom of the build phases. Of course I changed to "DWARF with dSYM File" and $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
.
我通过将“运行脚本”移到构建阶段的底部解决了这个问题。当然,我改为“带有 dSYM 文件的 DWARF”和$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
.
回答by shraddha
- Add script run phase at end of build phases.
- Set Shell for script phase to
/bin/bash
. Set input files to:
(1) $(PROJECT_DIR)/$(INFOPLIST_FILE). (2) $(PROJECT_DIR)/Scripts/set_bundle_build_number.sh Change path to path of script so changes you make to the script cause a re-run. (3) $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH) Fixes XCode 10 issues of duplicate output phases.
- 在构建阶段结束时添加脚本运行阶段。
- 将脚本阶段的 Shell 设置为
/bin/bash
. 将输入文件设置为:
(1) $(PROJECT_DIR)/$(INFOPLIST_FILE). (2) $(PROJECT_DIR)/Scripts/set_bundle_build_number.sh Change path to path of script so changes you make to the script cause a re-run. (3) $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH) Fixes XCode 10 issues of duplicate output phases.
回答by PatrickDotStar
The solution for me was to replace the round brackets with curly brackets like this
我的解决方案是用这样的大括号替换圆括号
${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}
${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}
You can check if the path actually exists if you call echo $(BUILT_PRODUCTS_DIR)
in the script phase. Using round brackets gave me following info in the Xcode build console "BUILT_PRODUCTS_DIR: command not found"
Replacing the round brackets with curly brackets will print the actuall path and therefore the script finally worked for me.
如果您echo $(BUILT_PRODUCTS_DIR)
在脚本阶段调用,您可以检查路径是否实际存在。使用圆括号在 Xcode 构建控制台中为我提供了以下信息“BUILT_PRODUCTS_DIR:未找到命令”用大括号替换圆括号将打印实际路径,因此脚本最终对我有用。
回答by Didats Triadi
None of the above works for me. If someone using Cocoapods, do these steps.
以上都不适合我。如果有人使用 Cocoapods,请执行以下步骤。
Add
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
to Input Files on Run Script section.Replace
./Fabric.framework/run
to"${PODS_ROOT}/Fabric/run"
in Run Script box.Go to Build Settings, search for
Debug Information
, Change it toDWARF with dSYM File
.
添加
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
到运行脚本部分的输入文件。在运行脚本框中替换
./Fabric.framework/run
为"${PODS_ROOT}/Fabric/run"
。转到构建设置,搜索
Debug Information
,将其更改为DWARF with dSYM File
。
It worked for me, at least.
至少对我有用。
回答by EsmaGo
For me changing the build system to "Legacy Build system" fixed the archiving error. To change the build system go to File -> Workspace Settings, and change the build system from default "New Build system" to "Legacy Build system".
对我来说,将构建系统更改为“传统构建系统”修复了存档错误。要更改构建系统,请转到 File -> Workspace Settings,并将构建系统从默认的“New Build system”更改为“Legacy Build system”。