在ARM Chromebook上使用Android开发环境? [英] Android Development Environment on an ARM Chromebook?

查看:93
本文介绍了在ARM Chromebook上使用Android开发环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已尝试多次在 ARM Chromebook(C100P),但安装始终会失败failed to run mksdcard tool错误.我已经读到发生这种情况是因为Android Studio依赖于与ARM处理器体系结构不兼容的本机二进制文件.即使尝试了各种黑客手段或仅尝试单独使用这些库之后,我仍然无法在ARM Chromebook上设置Android开发环境.

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.

推荐答案

本地结论:

我得出的结论是,您确实做不到. Android的编译工具依赖于本机库.具体来说,是lib32stdc++6lib32z1.它们依赖于32位Intel二进制文件,因此只有在Google开始进行一些更改之前,才有可能在ARM处理器上执行这些指令字(甚至没有i386多体系结构支持).

Native Conclusion:

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.

幸运的是,我在这里提出一种解决方法.我们将把计算委托给虚拟机.与这些二进制文件兼容的一种.它是免费安全的,因此您不必担心谁可以访问您的源代码.我们将使用 Google App Engine 实现这一目标.

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.

  1. 首先,下载最新的Crouton安装程序,具有完善的Ubuntu发行版可以使用.在Chromebook外壳程序内( Ctrl + Alt + T 并输入shell),执行安装程序.我选择在没有窗口管理器的情况下安装最新版本的Ubuntu Xenial.我还启用了与Crouton Chrome扩展程序的集成,以启用共享剪贴板.

  1. 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

下一步,enter-chroot进入Ubuntu,并安装curl和python:

Next, enter-chroot into Ubuntu, and install curl and python:

sudo apt-get update sudo apt-get install curl python git

使用curl获取Google Cloud SDK.您可以将其解压缩到默认位置~/google-cloud-sdk或您想要的其他目录.

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

在网络浏览器中启动Google Cloud Console的终端.接下来,在Google Cloud Console终端和本地Chromebook Shell中克隆您的存储库.

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

设计流程

仅此而已!如果您正确执行了这些步骤,则说明您已成功配置了一个Google虚拟机以进行Android编译.通过Google Cloud Console终端,可以为要编译的各种API级别添加Android平台支持.

Design Flow

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.

在这里,我们添加了API级别25和Android支持存储库,如下所示:

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

现在,使用git pull origin mastergit push origin master,您可以将在Chromebook上开发的代码上传到可能由Android SDK编译的存储库中.您可以通过执行项目的本地gradlew文件(即./gradlew build)来执行此操作.

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.

编译后,您可以pull将生成的二进制文件重新返回到开发计算机上,并使用adb install path/to/apk使用Android设备桥(adb)配置连接的Android设备.

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.

这篇关于在ARM Chromebook上使用Android开发环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆