I've tried multiple times to install and use Android Studio on an ARM Chromebook (C100P), but the installation always fails with the failed to run mksdcard tool
error. I've read that this happens because Android Studio depends on native binaries that aren't compatible with the ARM processor architecture; even after attempting various hacks or just trying to use the libraries alone, I am still not able to setup Android Development Environment on my ARM Chromebook.
Being able to run Android apps on a Chromebook is great, it gives users access to the vast Android ecosystem offerings and it gives Android developers the opportunity to reach Chrome OS users. Developers should make a point to verify their apps on different form factors, since this will help improve users' experiences.
Here's a running list of apps from the Chrome Web Store that can help you develop on your Chromebook or Chromium OS device: Chrome Dev Editor (Developer Preview) - Editor for building Web Apps and Chrome Apps, in JavaScript or Dart. CDE also supports Git and Polymer development.
Important: Once you turn on ADB, it's available to all accounts on your Chromebook.
ChromeOS Flex does not support ARM architecture. To provide a reliable and predictable experience, Google has tested and optimized many of the world's most popular models of Windows, Mac, and Linux devices.
I've come to the conclusion that you really just can't. Android's compilation tools depend upon native libraries; specifically, lib32stdc++6
and lib32z1
. These depend upon 32-bit Intel binaries, so there's no chance of executing these instruction words on an ARM processor (not even with i386 multiarch support) until Google starts making some changes.
Luckily, I'm here to present a workaround. We're going to delegate computation to a virtual machine; one that is compatible with these binaries. It'll be free and secure, so you don't have to worry about who gets access to your source code. We're going to achieve this using the Google App Engine.
I'm going to start this tutorial assuming we're using a fresh installation.
First, download the latest Crouton installer so we have a full-fledged Ubuntu distribution to work with. Within the Chromebook shell (Ctrl + Alt + T and enter shell
), execute the installer. I chose to install the latest version of Ubuntu, Xenial, without a window manager. I also enabled integration with the Crouton Chrome extension to enable a shared clipboard.
sudo sh ~/Downloads/crouton -r xenial -t touch,audio,keyboard,extension
Next, enter-chroot
into Ubuntu, and install curl and python:
sudo apt-get update
sudo apt-get install curl python git
Use curl to fetch the Google Cloud SDK. You may extract it to the default location ~/google-cloud-sdk
, or another directory you'd like.
curl https://sdk.cloud.google.com | bash
~/.bashrc
file.logout
or exit
, then re-enter using sudo enter-chroot
. This enables your Google Cloud SDK installation to be accessible from the command line.gcloud auth login
. This will require you to do two things; first, enable the SDK to access your Google Account. Secondly, you'll be required to copy a verification key from your browser at a supplied web address, which you'll need to paste back into the console.Launch the Google Cloud Console's terminal in your web browser. Next, make a clone of your repository within both the Google Cloud Console terminal and your local Chromebook shell.
gcloud init
gcloud config set project project-name-here
gcloud source repos clone repo-name-here
wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
unzip tools_r25.2.3-linux.zip
export ANDROID_HOME=path/to/unzipped/tools
.bashrc
to persist the installation across new server instances.
sudo apt-get install lib32stdc++ lib32z1
sudo apt-get install android-sdk-platform-tools-common android-tools-adb android-tools-adbd android-tools-fastboot
And that's everything! If you've followed these steps correctly, you'll have successfully configured one of Google's virtual machines for Android compilation. Via the Google Cloud Console terminal, it's possible to add Android platform support for various API Levels you wish to compile for.
Here, we add API Level 25, and the Android Support Repositories, as follows:
./android update sdk --filter android-25 --no-ui
./android update sdk -u -a -t android-25
./android update sdk --all --filter "extra" --no-ui
Now, using git pull origin master
and git push origin master
, you can upload code developed on your Chromebook onto the repository where it may be compiled by the Android SDK. You can do this by executing the project's local gradlew
file, i.e. ./gradlew build
.
Once compiled, you may pull
the generated binaries back onto your development machine and configure connected Android devices using the Android Device Bridge (adb
), using adb install path/to/apk
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With