Skip to content

Instantly share code, notes, and snippets.

@raco
Last active October 10, 2018 03:30
Show Gist options
  • Save raco/3117b7640ffcdd7db3e88968a876a44f to your computer and use it in GitHub Desktop.
Save raco/3117b7640ffcdd7db3e88968a876a44f to your computer and use it in GitHub Desktop.
Ionic 2 - Android setup for Ubuntu
# Android SDK setup
## Install Java
```bash
sudo apt-get update
sudo dpkg --add-architecture i386
sudo apt-get install libbz2-1.0:i386
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
# Si es ubuntu 14.04
# sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk openjdk-8-jre
```
Add JAVA_HOME to path via ~/.bashrc o ~/.zshrc
```bash
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
```
## Install Android Studio
## https://stackoverflow.com/questions/34556884/how-to-install-android-sdk-on-ubuntu
## removed lib32bz2-1.0
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
Download ZIP archive for Linux from: https://developer.android.com/studio/install.html
1. move the .zip to /opt
2. extract it
3. chown the folder to your name
4. chmod 777 studio.sh and run it for the installer
Now the android sdk is installed to ~/Android/Sdk
It's preferred to add ~/Android/Sdk folders to your path:
```bash
export PATH=${PATH}:~/Android/Sdk/tools
export PATH=${PATH}:~/Android/Sdk/platform-tools
```
Run `android`, install the images (atom, etc) and then navigate to Tools -> Manage AVDs and create a new image
Make sure to install the android-23 version and confirm it exists in ~/Android/Sdk/platforms/
sudo apt install gradle
# Ionic setup
## Pre-requisties
* Node.js v6
* npm v3
# Install latest cordova and ionic from npm
```bash
npm install -g cordova ionic
```
Abrir el proyecto con android studio para que termine de configurar el gradle.
chmod +x YouIonicProject/platforms/android/gradlew
Accept licenses
https://stackoverflow.com/questions/39760172/you-have-not-accepted-the-license-agreements-of-the-following-sdk-components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment