user2640633
user2640633

Reputation:

Google Fabric in Xcode 10 beta

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 Instructions

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

When I click the + it automatically generates $(SRCROOT)/newInputFile where newInputFile is automatically highlighted.

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?

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

Upvotes: 22

Views: 14531

Answers (10)

EsmaGo
EsmaGo

Reputation: 161

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".

Upvotes: 0

Didats Triadi
Didats Triadi

Reputation: 1502

None of the above works for me. If someone using Cocoapods, do these steps.

  1. Add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) to Input Files on Run Script section.

  2. Replace ./Fabric.framework/run to "${PODS_ROOT}/Fabric/run" in Run Script box.

  3. Go to Build Settings, search for Debug Information, Change it to DWARF with dSYM File.

It worked for me, at least.

Upvotes: 0

PatrickDotStar
PatrickDotStar

Reputation: 1794

The solution for me was to replace the round brackets with curly brackets like this

${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.

Upvotes: 0

shraddha
shraddha

Reputation: 11

  1. Add script run phase at end of build phases.
  2. Set Shell for script phase to /bin/bash.
  3. 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.
    

Check image for more reference

Upvotes: 1

Demetri Kulakoff
Demetri Kulakoff

Reputation: 192

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).

Upvotes: 1

Savas Adar
Savas Adar

Reputation: 4262

Go into Build settings of the your target. Find "Debug Information Format". Set this from "DWARF" in both debug and release to "DWARF with dSYM File"

source

settings image

Upvotes: 2

user10375102
user10375102

Reputation: 77

fabric info.plist error can be solved by changing the Xcode workspace settings-->build settings--> legacy build system

Upvotes: 2

Hardik Thakkar
Hardik Thakkar

Reputation: 15981

For Xcode 10 only, user's who face issue in final setup of fabric is your project.

From Xcode 10 you need to make one more setup in Build Phase's Input Files field.

Simply You need to copy this $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) and paste to Build Phase's Input Files field under Run Script as display in below image.

enter image description here

Read more on this link : https://fabric.io/kits/ios/crashlytics/install

Upvotes: 22

Danilo Gomes
Danilo Gomes

Reputation: 757

I did exactly what was recommend by Mahdi RB. Also followed the steps on official manual guide, didn't work.

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.

This is some proof of what I'm talking:

XCode pic

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:

IBAgent-iOS - assertion failed - libxpc.dylib - and some numbers here.

Error on 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.

  • I removed the original app names for privacy.

Upvotes: 5

Mahdi RB
Mahdi RB

Reputation: 121

I had same problem, if your info.plist is in your root directory like this:

Root directory tree

yo should change $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) like this:

Path image

Upvotes: 12

Related Questions