【问题标题】:Building Android Project (Zxing) with ANT使用 ANT 构建 Android 项目 (Zxing)
【发布时间】:2013-04-14 03:07:49
【问题描述】:

我是 Android 和基于 Ant 的构建过程的新手。我想构建托管在谷歌代码中的项目条码扫描器zxing。我下载了源代码并按照wiki 中的构建过程进行操作。该项目在根级别构建,但是当我在 android 文件夹中执行 ant 操作时出现错误。我使用的命令和wiki中的一样:

cd ../android 
ant debug 
ant install

错误是:

构建失败 /Users/StackUnderflow/Projects/zxing-read-only/android/build.xml:98:找不到从/Users/StackUnderflow/Projects/zxing-导入的/path/to/android-sdk/tools/ant/build.xml只读/android/build.xml

如何以及在哪里设置 ant 构建正在寻找的 android-sdk 的路径?构建过程会生成 ZXing-2.2.zip,但如何构建 apk 文件以加载到设备中?

【问题讨论】:

  • 抛弃 ANT,切换到 Maven。然后在这里找到xzing内核:search.maven.org/…
  • @ChristopherPerry Maven 不包含 Android 应用程序,因为它不是库。海报正在尝试构建 .apk

标签: java android ant build zxing


【解决方案1】:

错误就在那里。你没有走这一步,或者更确切地说,你没有改变路径!

echo "sdk.dir=/path/to/android-sdk" > local.properties

【讨论】:

  • 我将 sdk 的路径添加到 local.properties 。我现在收到以下错误:[aapt] invalid resource directory name: /Users/StackUnderflow/Projects/zxing-read-only/android/res/drawable-xxhdpi BUILD FAILED /Applications/eclipse/android-sdk-macosx/tools/ ant/build.xml:598:执行此行时出现以下错误:/Applications/eclipse/android-sdk-macosx/tools/ant/build.xml:627: null 返回:1
  • 听起来你的 Android SDK 已经过时了
猜你喜欢
  • 1970-01-01
  • 2012-05-31
  • 2011-11-06
  • 1970-01-01
  • 2012-08-10
  • 1970-01-01
  • 2015-03-20
  • 2011-03-11
  • 2015-05-31
相关资源
最近更新 更多