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

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

问题描述

我曾多次尝试在 Android Studio 上安装和使用 a href="https://archlinuxarm.org/platforms/armv7/rockchip/asus-chromebook-flip-c100p" rel="nofollow noreferrer">ARM Chromebook (C100P),但安装总是失败并显示无法运行 mksdcard 工具 错误.我读到这是因为 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.

推荐答案

Native 结论:

我得出的结论是你真的不能.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 shell 中(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

接下来,进入-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 初始化

gcloud config set project project-name-here

gcloud source repos clone repo-name-here

设计流程

就是这样!如果您正确地遵循了这些步骤,您将成功地为 Android 编译配置 Google 的虚拟机之一.通过 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 Level 25 和 Android Support Repositories,如下所示:

Here, we add API Level 25, and the Android Support Repositories, as follows:

./android update sdk --filter android-25 --no-ui

./android 更新 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生成的二进制文件回到您的开发机器上,并使用 Android Device Bridge (adb) 配置连接的 Android 设备,使用 adb安装路径/to/apk.

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天全站免登陆