CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme:

后端 未结 7 2161
灰色年华
灰色年华 2021-01-30 11:10

I understand this is an xcode warning/error, however, it happens when I try to run gitk --all from the command line.

YuFei-Zhus-MacBook-Pro:test phi         


        
相关标签:
7条回答
  • 2021-01-30 11:14

    On Mountain Lion 10.8.2, I fixed this issue installing/upgrading tcl and tk – as tair mentioned.

    brew install tcl
    brew install tk

    The UI of gitk will likely change, but you can tweak that in ~/.gitk.

    0 讨论(0)
  • 2021-01-30 11:14

    This blog post solved my issue for this:

    http://blog.jasonsemko.com/post/51668282398/easy-fix-for-cfurlcopyresourcepropertyforkey-failed

    The long and short of it is gitk isn't parsing the version string of git that comes with Xcode correctly, and is puking on the extra details.

    So to fix, you can install a git with a clean version number.

    brew install git

    You may need to make sure brew's version of git gets called by changing the order directories gets searched in your PATH (e.g., I had to load /usr/bin/local before /usr/bin). Alternatively, you can alias git to the absolute path installed by brew.

    0 讨论(0)
  • 2021-01-30 11:24

    Running gitk with a new version of tcl-tk seems to solve this problem (tested with Mac OS X 10.8.4). If you have Homebrew installed, the following should work:

    1. From the command line, run: brew install tcl-tk
    2. Then add the following to your .bashrc or .bash_profile: alias gitk='"$(brew --prefix tcl-tk)/bin/wish" "$(which gitk)"'

    After restarting your terminal, you should be able to run gitk normally without seeing any "CFURLCopyResourcePropertyForKey" errors.

    0 讨论(0)
  • 2021-01-30 11:27

    If you are MacPorts user upgrade tcl/tk to 8.6.0:

    $ sudo port install tcl tk
    
    0 讨论(0)
  • 2021-01-30 11:33

    I got this error just now and find a solution to solve it.

    I was trying to invoke the function getResourceValue:forKey:error: in my project and my os version is 10.7.5.

    I init a new NSURL object by using + URLWithString: and the problem occurred before, after I replace it with + fileURLWithPath:, it's ok now.

    The difference value between the two objects with different functions is /Volumes/Data/a file://localhost/Volumes/Data/a/

    Apple has statemented that about NSURL class below,

    Handling Object Creation Failure The NSURL class fails to create a new NSURL object if the path being passed is not well-formed; the path must comply with RFC 2396. Examples of cases that will not succeed are strings containing space characters and high-bit characters. Should creating an NSURL object fail, the creation methods return nil, which you must be prepared to handle. If you are creating NSURL objects using file system paths, you should use fileURLWithPath: or initFileURLWithPath:, which handle the subtle differences between URL paths and file system paths. If you wish to be tolerant of malformed path strings, you’ll need to use functions provided by the Core Foundation framework to clean up the strings.

    Error while using getResourceValue:forKey method in NSURL

    0 讨论(0)
  • 2021-01-30 11:34
    $ alias gitk='gitk 2>/dev/null'
    

    I have same problem here. This is quick tip until someone answers this solution.

    0 讨论(0)
提交回复
热议问题