title: OSX - Set Environment Variable for Android Studio via launchctl - works only after second launch
body: <p>This is in my ~/.bash_profile, since I need Android Studio / Gradle to have access to this variable.</p>
  
  <pre><code>#CCACHE
  export USE_CCACHE=1
  export NDK_CCACHE=/usr/local/bin/ccache
  launchctl setenv NDK_CCACHE $NDK_CCACHE
  </code></pre>
  
  <p>Interestingly, the variable is not set the first time I start Android Studio, but is always set the second time. </p>
  
  <p>What am I doing wrong that it does not work all the time / the first time already?</p>