git error: unable to index file Crashlytics.framework/Headers
Asked Answered
Y

4

18

I am using Twitter's Fabric on my iOS app.

Crashlytics in Fabric just updated itself and now I cannot commit my project to git. I get the error:

git error: unable to index file Crashlytics.framework/Headers

fatal: updating files failed

enter image description here

Any idea what is going wrong or how to fix it?

Running git status reveals:

Untracked files:
(use "git add <file>..." to include in what will be committed)

Crashlytics.framework/Info.plist
Fabric.framework/Info.plist
profile.xcodeproj/project.xcworkspace/xcuserdata/
profile.xcodeproj/xcuserdata/
Yaws answered 1/6, 2015 at 18:47 Comment(7)
Could you go to the directory and do git status and then a git remote -v and put the output here?Brentwood
@Brentwood I added some pertinent git status output. as for git remote -v it just showed my github repository for both push and fetchYaws
Did you try re-adding your repo in Xcode Preferences > Source Control?Brentwood
@Brentwood no. I need to re add it?Yaws
You could always ensure it's working fine. You could also try cleaning your workspace by a clean build and also a git clean -f -dBrentwood
@avnishkgaur Yes. I just posted an answer.Yaws
Thanks! I fixed it by using sourcetree.. :)Storyteller
Y
27

Going into terminal and manually committing to git solved the issue. All my further commits in xcode have worked since.

git add .
git commit -m "message"
Yaws answered 15/6, 2015 at 21:54 Comment(0)
E
11

I think this relates to the git submodule since I had similar issue. However adding or removing it didn't help. What worked was reseting it into HEAD version, e.g.

git reset HEAD problematic_file_or_dir
Errick answered 22/5, 2016 at 14:55 Comment(0)
W
2

The same issue happen to me with the Bolts.framework and Parse.framework. Both were added in the git repo already, so adding them back did not fixed the issue. I had to remove first:

cd MyApp/SDK/
git rm -r Parse.framework/
git rm -r Bolts.framework/

The I had to copy them again in the SDK/ folder and adding to git

 cd MyApp/SDK/
 git add .
 git commit * -m "Maintenance: Fixed git error unable to index file"
Waggle answered 21/9, 2015 at 1:6 Comment(1)
I managed to make it work by doing "git add" for the files under Bolts.framework and followed by "git commit" command line. Strange that I cannot do this under the Xcode UI.Sandry
O
1

This happened to me with IntelliJ IDEA. An error popup appeared when I tried to commit with the IDE git plugin. Probably this is related to the fact that I had staged a path that was previously a file but now is a directory, and have that previous file moved to the new directory.

Suppose that path is bin/yii. What I did was:

  • Rename the directory to something different, e.g. bin/yii-temp
  • Commit the directory and its contents
  • Rename the directory back to bin/yii
  • Commit with --amend what I had just committed.
Outstation answered 30/7, 2018 at 0:8 Comment(3)
Reported this as a bug: youtrack.jetbrains.com/issue/IDEA-196361Outstation
Thanks, worked for me! :-) Was exactly the case: I had deleted my gulpfile.js and created a folder with the same name (see gulpjs.com/docs/en/getting-started/javascript-and-gulpfiles).Aesthetic
Although amend didn't work for me. I just commited one more time.Aesthetic

© 2022 - 2024 — McMap. All rights reserved.