Scala + Android 新手

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8190820/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 03:40:41  来源:igfitidea点击:

Scala + Android Newbie

androidscalasbt

提问by Ray Goodwin

I am trying to use the scala-andriod plugin and I am having a problem running and configuring AVD's. Im getting following errors from sbt

我正在尝试使用 scala-andriod 插件,但在运行和配置 AVD 时遇到问题。我从 sbt 收到以下错误

android:emulator-start NexusOne [success] Total time: 0 s, completed Nov 18, 2011 7:07:53 PM emulator: ERROR: This AVD's configuration is missing a kernel file!!

android:emulator-start NexusOne [success] 总时间:0 秒,完成时间:2011 年 11 月 18 日晚上 7:07:53 模拟器:错误:此 AVD 的配置缺少内核文件!!

I have followed the direction on creating an avd but for some reason when I run the avd from sbt and android SDK manager I get that error.

我遵循了创建 avd 的方向,但是由于某种原因,当我从 sbt 和 android SDK 管理器运行 avd 时,我收到了那个错误。

Background: I used homebrew to install the sdk The .android folder containing the AVDs is in the default location mac home directory

背景:我使用自制软件来安装 sdk 包含 AVD 的 .android 文件夹位于默认位置 mac 主目录中

回答by RuiL

On the Android SDK manager, install/reinstall "ARM EABI v7a System Image" and then create a new AVD.

在 Android SDK 管理器上,安装/重新安装“ARM EABI v7a System Image”,然后创建一个新的 AVD。

回答by Ronnie

Maybe it helps some people:

也许它可以帮助一些人:

When running the "Android Virtual Device Manager". Clicking the Detail button, the AVD shows the AVD location on your system. Going to this directory will show you a config.ini file.

运行“Android 虚拟设备管理器”时。单击“详细信息”按钮,AVD 将显示您系统上的 AVD 位置。转到此目录将显示一个 config.ini 文件。

I changed the image.sysdir.1 value to something other in that particular file.

我将 image.sysdir.1 值更改为该特定文件中的其他值。

After going back to the AVD manager, it shows the virtual device with a repair option. Clicking the repair button wields something in the logs like:

返回 AVD 管理器后,它会显示带有修复选项的虚拟设备。单击修复按钮会在日志中显示以下内容:

[SDK Manager] Updated 'image.sysdir.1' with value 'add-ons/addon-google_apis-google-16/images/armeabi-v7a/'
[SDK Manager] Updated 'image.sysdir.2' with value 'system-images/android-16/armeabi-v7a/'

The thing to I noticed it added a image.sysdir.2 value. After this repair I can start the AVD without a missing kernel message.

我注意到它添加了一个 image.sysdir.2 值。修复后,我可以启动 AVD 而不会丢失内核消息。

回答by Julian Fondren

This is purely an error on the side of Android's emulator -- it has nothing to do with Scala, or SBT. You can find the text of the error in this code, if you like.

这纯粹是 Android 模拟器方面的一个错误——它与 Scala 或 SBT 无关。如果您愿意,您可以在此代码中找到错误的文本。

So, I don't know what directions you followed when you created the AVD, but the AVD is malformed. Create a new one by running the androidtool in the tools/ directory of the Android SDK, and then finding Manage AVDs...in the Toolsmenu.

所以,我不知道你在创建 AVD 时遵循了什么方向,但 AVD 格式错误。android在Android SDK的tools/目录下运行该工具,然后Manage AVDs...Tools菜单中找到,新建一个。

(And to save you some time: after you have a good AVD, use android:package-debugto build an .apk, and android:install-emulatorto move it into the emulator. You can do this while the emulator's running.)

(为了节省您一些时间:在您拥有良好的 AVD 后,使用android:package-debug构建一个.apk,并将android:install-emulator其移动到模拟器中。您可以在模拟器运行时执行此操作。)