ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Building stuff

asked 2012-03-28 08:04:57 -0500

amigo gravatar image

updated 2012-03-28 08:05:15 -0500

I'm new to rosjava. I've been reading a lot from and various links, but I'm having difficulty building the stuff in

How do you build the stuff in with gradle?

I'm particularly interested in testing out android_tutorial_pubsub, so I'm trying to build android_gingerbread first to get a jar file, but I'm not sure what gradle command to use.

I know that the following website is for rosjava_core, but I tried the commands anyway:

./gradlew tasks


clean debug deployLibs

'debug' doesn't work and 'deployLibs' only copies the libs from rosjava into a libs subdirectory.

Any help would be appreciated. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-03-28 08:56:58 -0500

jbohren gravatar image

updated 2012-03-28 10:43:53 -0500

It looks like the documentation is here:

Or, as it currently says:

roscd android_core
rosrun rosjava_bootstrap android_tutorial_pubsub
./gradlew android_tutorial_pubsub:debug

But I'm getting the following errors:

[ bowie:~/versioned/ros/3rd_party/android_core ] ./gradlew android_tutorial_pubsub:debug

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':android_gingerbread:compile'.
> Could not find group:ros.rosjava_core, module:apache_xmlrpc_client, version:0.0.0-SNAPSHOT.
  Required by:
      ros.android_core:android_gingerbread:0.0.0-SNAPSHOT > ros.rosjava_core:rosjava:0.0.0-SNAPSHOT
> Could not find group:ros.rosjava_core, module:apache_xmlrpc_server, version:0.0.0-SNAPSHOT.
  Required by:
      ros.android_core:android_gingerbread:0.0.0-SNAPSHOT > ros.rosjava_core:rosjava:0.0.0-SNAPSHOT
> Could not find group:ros.rosjava_core, module:apache_xmlrpc_common, version:0.0.0-SNAPSHOT.
  Required by:
      ros.android_core:android_gingerbread:0.0.0-SNAPSHOT > ros.rosjava_core:rosjava:0.0.0-SNAPSHOT

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


I've filed a ticket here:

It looks like you need to also run the following commands:

roscd rosjava_core
./gradlew rosjava:install
./gradlew apache_xmlrpc_common:install
./gradlew apache_xmlrpc_server:install
./gradlew apache_xmlrpc_client:install
./gradlew rosjava_tutorial_pubsub:install

Then you need to update the android project for your SDK:

roscd android_gingerbread
$ANDROID_SDK/tools/android update project -p `pwd`

Then you need to install ant1.8 if you don't have it (I didn't on 10.04)

sudo apt-get install ant1.8 ant1.8-optional

Then you should be able to build the example.

roscd android_tutorial_pubsub
../gradlew debug
edit flag offensive delete link more


Meanwhile, I just installed and ran it and it doesn't seem to be connecting...

jbohren gravatar image jbohren  ( 2012-03-28 11:02:08 -0500 )edit

This really helped. I still can't deploy to my Android device, but I'm further along than before.

amigo gravatar image amigo  ( 2012-03-28 20:05:26 -0500 )edit

if you can build it, then to install it on your device you just need to run: "$ANDROID_SDK/platform-tools/adb install bin/MainActivity-debug.apk" from the android_tutorial_pubsub directory.

jbohren gravatar image jbohren  ( 2012-03-29 04:01:27 -0500 )edit

Great--that worked! I was trying it with an Eclipse project and deploying it that way, but the resulting app kept failing with an error on the device. Thanks! I now have the same problem as you where it's not connecting (or at least communicating with the listener on my computer).

amigo gravatar image amigo  ( 2012-03-29 17:13:31 -0500 )edit

Question Tools


Asked: 2012-03-28 08:04:57 -0500

Seen: 1,438 times

Last updated: Mar 28 '12