Scala - Android app build failed

I follow the instructions for creating a Scala Android application at: scala-to-android

Basically, I installed Scala and changed the construction of ant build.properties to point to Scala and changed build.xml to include build-scala.xml.

ant scala-compile 

successful however

ant debug

generates the following build errors:

scala -compile:

-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.

I am new to ant, Android and Scala. Any help would be greatly appreciated. Thanks for that in advance!

+3
source share
3 answers

Android- Android Scala. script task.properties, scala/tools/ant/task.properties. ant -invoked.jar. , zip- android-sdk . "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" />

shrink-config

<target name="-shrink-config"
        description="Generate ProGuard configuration file">
    <taskdef resource="scala/tools/ant/task.properties"
             classpath="${ant-invoked.jar}" />
+3

Scala android Simple Build Tool (SBT) Android-

" ", Proguard.

+2

Hi, I have a blog that documents the steps for scala to work in android. It uses the android ant process and sticks close to the android path. You can see the tutorial here http://saadstechblog.blogspot.com/2011/09/scandroid-scala-android-tutorial.html . There is also a github project with all the configuration.

+1
source

Source: https://habr.com/ru/post/1787241/


All Articles