Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Building Android Test Projects

glenviewjeff edited this page Nov 25, 2011 · 17 revisions

Building Android Test Projects

Under construction (please feel free to fix this up)

Put your Android test code in {project dir}/tests/src/main/(scala, java, AndroidManifest.xml, assets, res, etc.) To build the tests, use sbt tests/android:package-debug

To avoid a circular dependency error like this, follow the below instructions:

sbt tests/android:package-debug
[info] Updating {file:/D:/Workspace/my-project/}tests...
[error] a module is not authorized to depend on itself: my-project#my-project_2.9.0-1;0.1

Thanks to this thread, I learned that you can just change the name of the test project like this:

 settings = General.settings ++ AndroidTest.androidSettings ++ Seq(
      name := "MyScalaProjectTest", 
      libraryDependencies += "com.jayway.android.robotium" % "robotium-solo" % "2.4", // If you're using Robotium
      libraryDependencies += "junit" % "junit" % "3.8.2",
      ...
  ) dependsOn main```
Clone this wiki locally