我正在按照以下说明为安卓构建Scala应用程序:scala-to-android
基本上,我安装了Scala并将ant build.properties更改为指向Scala,并将build.xml更改为包含build-scala.xml。
ant scala-compile 是成功的,然而,
ant debug生成以下生成错误:
scala-编译:
-shrink-if-test:
[echo] Checking if Scala libraries are installed on emulator or device...
[adb] BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
-shrink-config:
[taskdef] Could not load definitions from resource scala/tools/ant/task.properties. It could not be found.
BUILD FAILED
/home/salil/Programs/android-projects/FirstScala/build-scala.xml:82: Problem: failed to create task or type invoked
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.我是ant,Android和Scala的初学者。任何帮助都将不胜感激。提前谢谢你!
发布于 2011-01-23 21:30:12
我在Scala上使用android dev时也遇到了同样的问题。实际上,构建脚本查找一个名为task.properties的文件,该文件位于scala/tools/ant/task.properties中。它被打包在jar ant-voked.jar中。我希望您已经从该站点下载了android-sdk项目的zip压缩文件。只需将文件夹"configs“从android-sdk根目录复制到您的项目根文件夹中,就可以了。这就是它在scala-build.xml中搜索文件的位置
<!-- Project settings -->
property name="configs.dir" value="${basedir}/configs" />
<property name="ant-invoked.jar" value="${configs.dir}/ant/ant-invoked.jar" />和目标收缩配置
<target name="-shrink-config"
description="Generate ProGuard configuration file">
<taskdef resource="scala/tools/ant/task.properties"
classpath="${ant-invoked.jar}" />发布于 2011-01-23 19:01:06
目前,在安卓系统中使用Scala最稳定的方式是使用Simple Build Tool (SBT)和Android Plugin
它基本上“就是工作”,为你处理所有的步骤,并使用Proguard缩小。
发布于 2011-09-11 07:07:06
嗨,我在这里有一个博客,记录了让scala在android上工作的步骤。它利用了android的蚂蚁进程,并且紧跟android的方式。你可以在这里看到教程http://saadstechblog.blogspot.com/2011/09/scandroid-scala-android-tutorial.html。还有一个包含所有配置的github项目。
https://stackoverflow.com/questions/4772191
复制相似问题