RubyMotionJP / SublimeRubyMotionBuilder

Sublime Text 2 and 3 plugin to simplify RubyMotion developing
151 stars 19 forks source link

Android support #41

Open awernick opened 9 years ago

awernick commented 9 years ago

Using the latest build from Package Installer, SublimeRubyMotionBuilder keeps complaining about the android.sdk_path not pointing to a valid Android SDK directory. Running rake commands works without any hiccup, and I have insured that my launchd.conf config contains the instruction to add the PATH variable.

Using OSX Yosemite and latest RubyMotion

Error Message:

ERROR! app.sdk_path should point to a valid Android SDK directory.
[Finished in 0.9s]

Launchd.conf:

setenv PATH /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/awernick/.rvm/gems/ruby-2.1.5/bin:/usr/bin:/usr/sbin:/bin:/usr/local/bin:/sbin:/opt/x11/bin:/Users/awernick/.rbenv/shims:/Users/awernick/.rvm/gems/ruby-2.2.0/bin:/Users/awernick/.rvm/gems/ruby-2.2.0@global/bin:/Users/awernick/.rvm/rubies/ruby-2.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/msp430-toolchain/bin:/Users/awernick/.rvm/bin:/Users/awernick/android-rubymotion/sdk:/Users/awernick/android-rubymotion/ndk
setenv RUBYMOTION_ANDROID_NDK /Users/awernick/android-rubymotion/ndk
setenv RUBYMOTION_ANDROID_SDK /Users/awernick/android-rubymotion/sdk

RUBYMOTION_ANDROID_NDK variable

Alans-MacBook-Air:~ awernick$ $RUBYMOTION_ANDROID_NDK
-bash: /Users/awernick/android-rubymotion/ndk: is a directory

RUBYMOTION_ANDROID_SDK variable

Alans-MacBook-Air:~ awernick$ $RUBYMOTION_ANDROID_SDK
-bash: /Users/awernick/android-rubymotion/sdk: is a directory

PATH variable

Alans-MacBook-Air:~ awernick$ $PATH
-bash: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/awernick/.rvm/gems/ruby-2.1.5/bin:/usr/bin:/usr/sbin:/bin:/usr/local/bin:/sbin:/opt/x11/bin:/Users/awernick/.rbenv/shims:/Users/awernick/.rvm/gems/ruby-2.2.0/bin:/Users/awernick/.rvm/gems/ruby-2.2.0@global/bin:/Users/awernick/.rvm/rubies/ruby-2.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/msp430-toolchain/bin:/Users/awernick/.rvm/bin:/Users/awernick/android-rubymotion/sdk:/Users/awernick/android-rubymotion/ndk: No such file or directory
awernick commented 9 years ago

I was able to find a solution for my problem. Apparently OSX Yosemite does not set enviornment variables through Launch.d anymore. A work around was to use launchctl to set the necessary variables, although this is only for the current session and will be wiped after a reboot.

To set the environment variables in Yosemite use

launchctl setenv RUBYMOTION_ANDROID_NDK $RUBYMOTION_ANDROID_NDK
launchctl setenv RUBYMOTION_ANDROID_SDK $RUBYMOTION_ANDROID_SDK

then close SublimeText and MotionBuilder should work correctly.

Watson1978 commented 9 years ago

Now, not support Android platform.

trekr5 commented 8 years ago

Hi,

I'm experiencing this error when i run rake device:

ERROR! app.sdk_path should point to a valid Android SDK directory. Run 'motion android-setup' to install the latest SDK version.

when i attempt to create an android application using RubyMotion on a mac. I've tried the awernick answer and still receive the same error.

gregogalante commented 8 years ago

Someone know how to solve the problem? I found that $RUBYMOTION_ANDROID_SDK is not set on my Mac