0
$\begingroup$

Rosanswers logo

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!


Originally posted by amigo on ROS Answers with karma: 93 on 2012-03-28

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

Originally posted by jbohren with karma: 5809 on 2012-03-28

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by jbohren on 2012-03-28:
Meanwhile, I just installed and ran it and it doesn't seem to be connecting...

Comment by amigo on 2012-03-28:
This really helped. I still can't deploy to my Android device, but I'm further along than before.

Comment by jbohren on 2012-03-29:
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.

Comment by amigo on 2012-03-29:
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).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.