Google Fabric in Xcode 10 beta
Asked Answered
T

10

22

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

Tirol answered 16/8, 2018 at 4:46 Comment(5)
Mike from Fabric here. Can you confirm which version of Fabric and Crashlytics you're installing and macOS version?Ara
@MikeBonnell Hi Mike, In my Podfile I have pod 'Fabric' so whatever the latest stable release version I guess. The macOS version is 10.13.6Tirol
Can you share the crash you're seeing?Ara
What was the resolution?Beguin
This should be the top answer! Thank youBerberine
E
6

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.
Eternize answered 3/10, 2018 at 21:1 Comment(4)
what is the "aaaaa aaaa"Tirol
they were my keys from fabric. They should match your project. If you are logged in fabric website, should be something from here: fabric.io/kits/ios/crashlytics/manual-install?step=1Eternize
You can try to add "sleep 15" before the "fabric run" lineEternize
the workaround with sleep worked for me.. 1 could do it actuallyFashionable
S
21

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

Seato answered 6/10, 2018 at 17:50 Comment(3)
does anyone know what $(INFOPLIST_PATH) is?Frock
@kidnapper just copy and paste that line, no need to change anything for that.Seato
@HardikThakkar I know. Just curious about what that is exactly.Frock
F
12

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

Feinstein answered 26/9, 2018 at 13:32 Comment(3)
Hi! Welcome to StackOverflow! I would suggest you to be describe, at least in some detail, the content of the images to have a better clue on what to look for in them.Muco
If the info.plist is in a sub group would i change it to subGroupName/info.plist?Tirol
@Tirol I don't think you should, if you go to the project file in Finder you can see all the file is in the folder with your project name, and the group in Xcode simply show you with that GUI but the path for the file doesn't change. I'm not quite sure, but that make sense to me.Frock
E
6

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.
Eternize answered 3/10, 2018 at 21:1 Comment(4)
what is the "aaaaa aaaa"Tirol
they were my keys from fabric. They should match your project. If you are logged in fabric website, should be something from here: fabric.io/kits/ios/crashlytics/manual-install?step=1Eternize
You can try to add "sleep 15" before the "fabric run" lineEternize
the workaround with sleep worked for me.. 1 could do it actuallyFashionable
I
2

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

Imago answered 18/1, 2019 at 5:44 Comment(0)
G
2

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

Goldenrod answered 14/3, 2019 at 21:8 Comment(0)
R
1

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

Revoke answered 19/3, 2019 at 10:33 Comment(0)
M
1
  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

Milne answered 26/3, 2019 at 10:57 Comment(0)
I
0

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.

Indianapolis answered 13/4, 2019 at 7:57 Comment(0)
O
0

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.

Offshore answered 12/7, 2019 at 13:14 Comment(0)
D
0

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

Darleen answered 1/8, 2019 at 14:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.