Xcode 10 command-line building: Archive failed with Fabric Info.plist Error
Asked Answered
C

7

17

I have Jenkins server for autobuilding iOS project that has two targets. Project builds with command-line utility xcodebuild.

Full commands are

/usr/bin/xcodebuild -workspace "Our project.xcworkspace"
    -scheme "First target"
    -configuration Release
    archive
    DEVELOPMENT_TEAM=TEAMCODE
    -allowProvisioningUpdates

and

/usr/bin/xcodebuild -workspace "Our project.xcworkspace"
    -scheme "Second target"
    -configuration Release
    archive
    DEVELOPMENT_TEAM=TEAMCODE
    -allowProvisioningUpdates

Before I did update Xcode to version 10 it works perfectly. But after updating each time I see error

error: Fabric: Info.plist Error

Unable to process Info.plist at path /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/Our_project-xxxx/Build/Intermediates.noindex/ArchiveIntermediates/Our project/BuildProductsPath/Release-iphoneos/First application.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 Our application.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.

** ARCHIVE FAILED **

After googling and reading error description I did open Build phases tab in Xcode and set up it (move Run script item to bottom, check Run script only when installing and add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) to Input files and also remove empty Run script item).

Manual building from command line now works - it seems like problem solved. Even Jenkins did build first target! But secong target did not with same error.

I did open project, look Build phases tab and saw that Run script item moved above and new empty Run script appeared. After that I did experiment: set up Build phases, rebuild project in Xcode GUI and saw that phases reordered again. So, it occurs during or after building.

How can I fix this bug?

Say, can I order build phases manually from command line? If yes, I just append row in Jenkins step.

In addition: this error appears only in command-line building. When I build project from Xcode GUI it always succeeds.

Caecum answered 26/9, 2018 at 5:34 Comment(0)
A
20

I moved "Run Script" with crashlytics to the end after "Embed pods Frameworks" and "Copy pods Resources" and that helpedenter image description here

Anthropometry answered 30/9, 2019 at 17:3 Comment(0)
J
19

Okay, I got the solution form Fabrics. For Xcode 10, add this path to the Input Files in Build phase in XCode $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

enter image description here

Joli answered 5/10, 2018 at 6:11 Comment(3)
But I added it too: "After googling and reading error description I did open Build phases tab in Xcode and set up it (move Run script item to bottom, check Run script only when installing and add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) to Input files and also remove empty Run script item)."Caecum
Worked for me, when moving an old Xcode 10 project to Xcode 10.2.1 and having deleted the old derived data.Phonologist
I had this problem and it turned out I was running the script too early. It's best run closer to last.Metagnathous
C
8

I found crutch-like solution: select Legacy Build System at File -> Workspace Settings -> Build System in Xcode GUI.

Why this solution is bad? Because of:

  • Legacy Build System is slower than New Build System (Default).

  • It's not Xcode setting but workspace. I.e. after cleaning workspace folder in Jenkins or some version control system actions will reset this setting to default, and non-working option will select again.

Caecum answered 26/9, 2018 at 10:2 Comment(2)
have you got another solution?Wilmerwilmette
Unfortunately not yetCaecum
A
6

Solution to complete the setup of Crashlytics and/or Fabric using following:

  1. Go to Build Settings
  2. Search "Debug Information Format"
  3. Change value of "Debug" from "DWARF" to "DWARF with dSYM File"
  4. Build your project again.

Change "DWARF"

enter image description here

To "DWARF with dSYM File"

enter image description here

Ashleeashleigh answered 19/12, 2018 at 12:36 Comment(5)
I already have DWARF with dSYM File for Debug Information Format optionCaecum
@GeneralFailure Can you check with this, it may help https://mcmap.net/q/429775/-crashalytics-not-working-for-xcode-10-ios12Ashleeashleigh
@GeneralFailure Have you found a solution for this ?Echo
Sorry, I can not check it now because I changed working project.Caecum
This worked for me. Looks like Fabric needs that dSYM file to detect and move forward. Thanks @BhavikModiHarte
B
6

I deleted derived data of the project and it resolved the issue

Bomb answered 5/1, 2020 at 9:24 Comment(0)
D
1

Xcode 15.0:

move Run script item to bottom, check Run script only when installing and add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) to Input files

Dominations answered 4/10, 2023 at 10:43 Comment(1)
it might be helpful to phrase this as steps / bulletpointsHarappa
L
0

Put $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) under Input Files in your Build Phases Run Script

Latchkey answered 12/4, 2021 at 22:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.