Skip to content

Troubleshooting ROSTango Build Failures

shilohc edited this page Sep 4, 2014 · 16 revisions

Missing SDK/SDK location not found:

First, make sure you installed all SDK pieces described in Getting Started with Tango and ROS. If you think you may have forgotten anything, open the Android SDK Manager and check.

> android

If that seems correct, check that $ANDROID_HOME points to your SDK location.

> echo $ANDROID_HOME
/opt/android-studio/sdk

Make sure to start a new terminal session after changing environment variables like $ANDROID_HOME.

Failed to parse SDK:

This error can generally be solved quite simply by creating a file in ~/rjandroid/src/ROSTango/ROSTango/src/rostango called local.properties containing the following:

sdk.dir=/opt/android-studio/sdk

(If your SDK is located elsewhere, modify as needed.)

Could not resolve all dependencies:

First, open up ~/rjandroid/src/ROSTango/ROSTango/src/rostango/build.gradle. There should be a call to at least one of mavenCentral() and mavenLocal() in the repositories section (under buildscript). If only mavenLocal() is present, add mavenCentral() directly above it. If that doesn't work, try commenting out mavenLocal().

If the error persists, you may want to try to find the dependency yourself, or download it if it doesn't seem to exist.

Alternatively, you may want to simply remove the dependency in some situations (such as if the dependency's only purpose seems to be debugging software that works well). There are a few faulty dependencies, which end in SNAPSHOT like the one below, where this is probably the best option.

A problem occurred configuring project ':tango_serial'.
> Could not resolve all dependencies for configuration ':tango_serial:_debugCompile'.
   > Could not resolve org.ros.tf2:tf2_ros:0.0.0-SNAPSHOT.
     Required by:
         com.github.rosjava.rostango:tango_serial:0.1.0
      > java.lang.NullPointerException (no error message)

If you want to remove a dependency altogether, find the build.gradle file for the correct project (in this case, tango_serial), locate the dependencies section, and comment out the dependency you wish to remove.

Failed to find target android-19 (or any other version)

Here, something is most likely trying to use an API that you haven't installed. Make sure you've installed all the APIs from Getting Started with Tango and ROS. If the error persists, it's probably best to download the required API using the Android SDK Manager.

> android

Lint found errors in the project; aborting build

By default, the build will abort if lint finds any issues in a project. It's probably a good idea to check the lint report for anything particularly serious. However, if all the issues seem minor, you may want to modify the project's build.gradle file so that the build will proceed despite errors.

First, determine which project is failing lint. There should be a line in the error message resembling the following:

Execution failed for task ':tango_serial:lint'.  

In this case, the failing project is tango_serial.

Next, locate the project's build.gradle file. In the case of tango_serial, this file is located at ~/rjandroid/src/ROSTango/ROSTango/src/rostango/tango_serial/build.gradle. Do not use the build.gradle located in rostango.

Add the following to the android section:

lintOptions {
  abortOnError false
}

The project should now build despite lint errors. You may have to repeat this process for multiple projects.