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

Building rosjava.android 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 answers.ros.org and various links, but I'm having difficulty building the stuff in rosjava.android.

How do you build the stuff in rosjava.android 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: http://docs.rosjava.googlecode.com/hg/rosjava_core/html/building.html

./gradlew tasks

shows

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
1

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: http://docs.rosjava.googlecode.com/hg/android_core/html/building.html

Or, as it currently says:

roscd android_core
rosrun rosjava_bootstrap install_generated_modules.py 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
:android_gingerbread:deployTransitiveLibs

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.

BUILD FAILED

I've filed a ticket here: http://code.google.com/p/rosjava/issues/detail?id=93

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

Comments

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

Stats

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

Seen: 1,435 times

Last updated: Mar 28 '12