Skip to content

Instantly share code, notes, and snippets.

@nicksoto
Created June 6, 2012 03:29
Show Gist options
  • Save nicksoto/2879726 to your computer and use it in GitHub Desktop.
Save nicksoto/2879726 to your computer and use it in GitHub Desktop.
Android Build Setup for Rhomobile
Tested only on Mac 10.7.4, Core 2 Duo
1.) Go to oracle.com and download the java jdk. My files were output to:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk
2.) gem install rhodes (or sudo gem install rhodes)
3.) Assuming you have Homebrew installed:
brew install qt (this make take an hour to install)
brew install android-ndk
brew install android-sdk
4.) Type "android" in terminal. An android download manager should open. Find Android 4.0.3 and install "SDK platform" and the x86 system image. Close the android manager.
5.) Open .bash_profile
in the bash_profile, you may need to include some or all of these:
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export QTDIR=/usr/local/Cellar/qt/4.7.0/bin (4.7 worked for me. I did not test 4.8)
export ANDROID_HOME=/usr/local/Cellar/android-sdk/r18 (take note of the version. yours may be different)
export ANDROID_NDK_HOME=/usr/local/Cellar/android-ndk/r8 (same comment as above)
close terminal completely so new paths are recognized (or you can also source the file)
6.) Enter "rhodes-setup" in terminal and all paths should be recognized. if android-ndk is not recognized (it did not for me at first) a dirty workaround is to modify the rhodes-setup source file like so:
# try to detect android ndk
ndk = ""
if ENV['ANDROID_NDK_HOME']
ndk = ENV['ANDROID_NDK_HOME']
end
androidndk = prompt_for("Android NDK path", ndk, false)
7.) Lastly, the build.yml file in your project folder should reference android:
android:
version: 4.0.3
8.) cd into the project folder and type "rake run:android". If all goes well, the emulator should open along with your project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment