Install Android SDK on C9

android

#1

Hi, I’m trying with ionic framework and when running cordova build for android, an error show up as below Running command: /home/ubuntu/workspace/bongda/code/ionic/platforms/android/cordova/build --release
[Error: Failed to find ‘ANDROID_HOME’ environment variable. Try setting setting it manually.
Failed to find ‘android’ command in your ‘PATH’. Try update your ‘PATH’ to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /home/ubuntu/workspace/bongda/code/ionic/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/ubuntu/workspace/bongda/code/ionic/platforms/android/cordova/build: Command failed with exit code 2
I guess I need to install android sdk on C9 env but not sure how to do it.


Problems installing Android SDK in Meteor Workspace
#2

Keep trying it and report back if you get it working @chiisana. Sounds cool.

From what I found searching most people seem to be doing phonegap for mobile apps in Cloud9 currently:


#3

Hi @chiisana,

You can find the Android SDK here and install it on the Cloud9 workspace as per instructions present on the site.

Happy coding! :smile:

Regards,
​Mutahhir


How to install android SDK into meteor workspace?
#4

I installed the Android SDK following the instructions and all went well. When I try building my app into an android project, it is throwing the following error, which is related to a shared library.

cordova build --release android
[lots of output …]

/home/ubuntu/opt/android-sdk-linux/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

A Google search turned up a Stack Overflow post saying to install a package, however, my account doesn’t have permissions. Here is what they suggested installing in the post:

sudo apt-get install lib32z1

Is there a way to get that installed for use?

Here is a link to the SO post explaining the packages they installed to get past this error:


#5

For reference, the answer to the above question can be found here How can I install a shared library (libz.so) in my workspace?.


#6

Now-a-days the Android Studio install page linked above only instructs on how to install the graphical IDE. To install android SDK on C9’s Ubuntu at the time of this writing you’ll want to try these two steps (they seemed to have worked for me at least):