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

11,299

Solution 1

alias gk='gitk --all 2> /dev/null &' (I am on mac)

I have it in the ~/.bash_login file, and it solves it :D

you can also put it the .bashrc file

Solution 2

$ alias gitk='gitk 2>/dev/null'

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

Solution 3

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

$ sudo port install tcl tk

Solution 4

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.

Solution 5

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.

Share:
11,299
phil88530
Author by

phil88530

Ruby on Rails WordPress iPhone & iPad Apps Android Mobile & Pad Apps

Updated on June 20, 2022

Comments

  • phil88530
    phil88530 almost 2 years

    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 phil88530$ gitk --all
    2012-08-02 21:14:49.246 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:49.252 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:49.293 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:49.295 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:49.474 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:49.476 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:50.731 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    2012-08-02 21:14:50.734 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
    YuFei-Zhus-MacBook-Pro:test phil88530$ 
    

    I just replaced a new disk and did a fresh install of osx and updated to mountain lion, installed x11 and xcode. Any suggestions why this happens?

  • Olaf
    Olaf over 11 years
    For those of us who put the alias into ~/.bash_profile or similar, but don't want to log out-of/back-into the shell: run $ .<space> ~/.bash_profile to activate
  • Dan Crews
    Dan Crews over 11 years
    Is . ~/.bash_profile better than $ source ~/.bash_profile?
  • M.Hamza Ali
    M.Hamza Ali over 11 years
    Note: This Just Hides the Error Messages* The alias justs redirects gitk's stderr output (file device 2) to /dev/null, thereby masking all errors generated by gitk forever. Probably not a big deal, but if you are using this you should be aware of what it's doing.
  • Matt
    Matt over 11 years
    this doesn't sound like a good long term answer. has anyone reported this to the gitk maintainers? another option would be to use git cola instead, it has similar functionality under git dag. though I'd still like to see this fixed
  • formigarafa
    formigarafa over 11 years
    I liked your answer. But it actually doesn't say how to solve the problem. Did you hacked the gitk code? If so, how?
  • Itachi
    Itachi over 11 years
    Sorry, I didn't have a try yet.
  • Kache
    Kache about 11 years
    This answer actually solves the problem, rather than suppress the error.
  • Kache
    Kache about 11 years
    It also changes hotkeys, and cmd-tab functionality, keyboard repeat speed (which can be fixed). I ended up reverting =\
  • MechEthan
    MechEthan about 11 years
    You should edit your post to clarify what your quick tip does.
  • Tair
    Tair about 11 years
    @Kache can you give more details on hotkey and kbd-speed problems, please, so I try to reproduce these with Macports. Also can't get the cmd-tab issue -- isn't it reserved by OSX?
  • Kache
    Kache about 11 years
    @tair Before, gitk is opened as "Wish". After, it's opened as "X11". The default keyboard repeat speed for X11 was painfully slow, so solution: superuser.com/questions/414237/key-repeat-x11-xterm-urxvt. The cmd-tab issue may be related to me using Witch on Mac. Wish was cmd-tabable as normal. X11's window 'goes to sleep'/'is hidden' after it loses focus and is de-prioritized down the Witch cmd-tab list, and Witch needs to "Activate" or "Relaunch" the window. I'm not sure how to explain it better concisely.
  • Tair
    Tair about 11 years
    @Kache The only issue I have is what you call cmd-tab -- and I had it even before Tcl/Tk update, and yes, it's annoying :(
  • Tair
    Tair about 11 years
    @Kache for cmd-tab functionality, please vote here: thread.gmane.org/gmane.comp.version-control.git/220724/…
  • Tair
    Tair almost 11 years
    @Kache my patch was accepted! Now gitk window always appears in front.
  • champagniac
    champagniac over 10 years
    You might have to run brew tap homebrew/dupes before brew install tcl-tk, if you already havn't done so.
  • Niloct
    Niloct over 10 years
    This breaks the preferences section of gitk, including the colors and also it blurs somehow the text glyphs in the lower left section.
  • Rich
    Rich almost 9 years
    Using a homebrew git seems a much better solution than using a homebrew Tcl/Tk with Apple's git. (Or just hiding the errors.) Upvoted.
  • Marcy
    Marcy almost 3 years
    Thank-you. Having the path prefixed with "file://localhost/" worked for me.