使用 Android ADK 与 Arduino Mega ADK 通信时 build.xml 的问题 [英] Problems with build.xml when using the Android ADK to communicate with an Arduino Mega ADK

查看:21
本文介绍了使用 Android ADK 与 Arduino Mega ADK 通信时 build.xml 的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以几天前我拿到了一块 Arduino Mega ADK 板,最近几个晚上我一直在设置我的开发环境,掌握工具等.工具和库都工作正常,例如,我可以在 Processing IDE 中编写一个程序,以便在运行 Android 4.03 的 Asus Eee Pad Transformer TF101 上编译和运行.但是当我让它尝试编译并运行其中一个预先编写的示例时,它给了我一个编译器错误:

So a few days ago I got my hands on an Arduino Mega ADK board, and the last couple of nights I have been setting up my development environment, getting to grips with the tools etc. The tools and libraries all work fine, for example I can get a program written in the Processing IDE to compile and run on an Asus Eee Pad Transformer TF101 running Android 4.03. But when I get it to try to compile and run one of the pre-written examples, it gives me a compiler error:

Android SDK 工具修订版 20安装在 C:\NVPACK\android-sdk-windows项目类型:应用项目目标:Android 2.3.3API 级别:10库依赖:没有图书馆

Android SDK Tools Revision 20 Installed at C:\NVPACK\android-sdk-windows Project Type: Application Project Target: Android 2.3.3 API level: 10 Library dependencies: No Libraries

API<=15:将 annotations.jar 添加到类路径.将 AndroidManifest 文件合二为一.清单合并已禁用.仅使用项目清单.无需编译 AIDL 文件.没有要编译的 RenderScript 文件.正在生成资源 ID...正在生成 BuildConfig 类.

API<=15: Adding annotations.jar to the classpath. Merging AndroidManifest files into one. Manifest merger disabled. Using project manifest only. No AIDL files to compile. No RenderScript files to compile. Generating resource IDs... Generating BuildConfig class.

构建失败C:\NVPACK\android-sdk-windows\tools\ant\build.xml:680: 执行此行时出现以下错误:C:\NVPACK\android-sdk-windows\tools\ant\build.xml:693:编译失败;详情请参阅编译器错误输出.

BUILD FAILED C:\NVPACK\android-sdk-windows\tools\ant\build.xml:680: The following error occurred while executing this line: C:\NVPACK\android-sdk-windows\tools\ant\build.xml:693: Compile failed; see the compiler error output for details.

总时间:7 秒

这就是控制台似乎也输出的所有内容,这很令人沮丧!据我所知,我所有的 SDK 版本、工具和插件都是最新的.我已经使用硬盘驱动器上的 Linux 分区进行了尝试,但它产生了相同的错误消息,尽管它提到了包 com.Android.future.UsbAccessory 的问题.鉴于我所看到的,问题似乎出在工具上,要么是我的目录结构与正确设置不匹配,要么是其他错误:S.如果有人遇到过类似的问题,一些帮助将是粉碎的!(作为记录,我的设置是使用 Arduino 网站上的说明完成的,尽管我已经安装了 Android SDK 工具).威尔·斯科特·杰克逊

And that's all the console seems to output as well, which is rather frustrating! As far as I'm aware all of my SDK versions, tools and plugins are all up to date. I've tried this using a Linux partition I have on my hard drive and it produces the same error message, although it mentions a problem with the package com.Android.future.UsbAccessory. Given what I've seen, it seems that the problem is with the tools, either my directory structure doesn't match up to what the correct setup is, or something else is wrong :S. If anyone has had similar problems, some help would be smashing! (For the record, my setup was done using the instructions on the Arduino website, although I already had the Android SDK tools installed). Will Scott-Jackson

推荐答案

听起来您还没有在 支持库 到您的项目和/或您尚未将其下载到您的 Android SDK 中.

It sounds like your haven't added in the support library to your project and/or you haven't downloaded it into your Android SDK.

ADK1 演示套件应用面向 API 级别 10(Android 2.3.3);这意味着您需要在项目中使用支持库,这就是编译器抱怨 10 级库依赖项不可用的原因.支持库在 SDK Manager 中单独下载,因此您可能在您的开发环境中没有它们.

The ADK1 demokit app targets API Level 10 (Android 2.3.3); That means you need to use the support libraries in your project and that's why the compiler is complaining about level 10 library dependencies not being available. The support libraries are a separate download in the SDK Manager, so you might not have them in your development environment.

在 Android API Level 12 及更高版本中,USB Accessory 协议被添加到框架 API 中,因此有 两种不同的方式来使用附件协议.因此,如果您的目标是 Honeycomb 和更高版本,则不必使用支持库,但您必须更新 demokit 应用代码才能使其正常工作.

In Android API Level 12 and higher, the USB Accessory protocol was added to the framework API, so there are two different ways to use the accessory protocol. So, you don't have to use the support libraries if you are targeting Honeycomb and higher versions, but you'll have to update the demokit app code to make this work.

希望这会有所帮助.

这篇关于使用 Android ADK 与 Arduino Mega ADK 通信时 build.xml 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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