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

catkin_make android_core SDK directory

asked 2014-07-31 05:58:27 -0600

stefan gravatar image

updated 2014-08-01 06:23:51 -0600

Next troubles for me

ht tp://wiki.ros.org/android/Tutorials/hydro/Installation%20-%20Ros%20Development%20Environment

catkin_make @ android directory

i get the error

* What went wrong:
A problem occurred configuring project ':android_acm_serial'.
> The SDK directory '/opt/android-studio/sdk:/home/user/opt/android-studio/sdk' does not exist.

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

BUILD FAILED

Total time: 3.248 secs
make[2]: *** [android_core/CMakeFiles/gradle-android_core] Fehler 1
make[1]: *** [android_core/CMakeFiles/gradle-android_core.dir/all] Fehler 2
make: *** [all] Fehler 2

install directory for android studio: /home/user/opt/android-studio

$ echo $PATH
/opt/ros/hydro/bin
:/home/user/catkin_ws_android_core/devel/bin
:/opt/eclipse:/usr/lib/lightdm/lightdm:/usr/local/sbin
:/usr/local/bin
:/usr/sbin
:/usr/bin
:/sbin:/bin:/usr/games
:/home/user/catkin_ws/tool_scripts
:/opt/android-studio/sdk/tools
:/opt/android-studio/sdk/platform-tools
:/opt/android-studio/bin
:/home/user/home/user/opt/android-studio/sdk/tools
:/home/user/home/user/opt/android-studio/sdk/platform-tools
:/home/user/home/user/opt/android-studio/bin
:/home/user/opt/android-studio/sdk/tools
:/home/user/opt/android-studio/sdk/platform-tools
:/home/user/opt/android-studio/bin

$ echo $ANDROID_HOME
/opt/android-studio/sdk
:/home/user/opt/android-studio/sdk

Edit: Thanks to support from gvdhoorn i got a little step further

  • installed android tools (adb) from ht tp://bernaerts.dyndns.org/linux/74-ubuntu/245-ubuntu-precise-install-android-sdk
  • i ve hardcoded the variables ANDROID_HOME and PATH in .bashrc and opend an other terminal (that solved my problem)

java 7 is already installed

catkin_make starts running with a lot of warnings

warning: Ignoring InnerClasses attribute for an anonymous inner class (junit.swingui.TestSelector$4) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class.

and finally fails -> next error:

:android_acm_serial:uploadArchives

Uploading: org/ros/android_core/android_acm_serial/0.1.3/android_acm_serial-0.1.3.aar to repository remote at file:///opt/ros/hydro/share/maven
Specified destination directory cannot be created: /opt/ros/hydro/share/maven/org/ros/android_core/android_acm_serial/0.1.3
:android_acm_serial:uploadArchives FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':android_acm_serial:uploadArchives'.
> Could not publish configuration 'archives'
> Error deploying artifact 'org.ros.android_core:android_acm_serial:aar': Error deploying artifact: Specified destination directory cannot be created: /opt/ros/hydro/share/maven/org/ros/android_core/android_acm_serial/0.1.3

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

BUILD FAILED

Total time: 6 mins 56.909 secs
make[2]: *** [android_core/CMakeFiles/gradle-android_core] Fehler 1
make[1]: *** [android_core/CMakeFiles/gradle-android_core.dir/all] Fehler 2
make: *** [all] Fehler 2
Invoking "make" failed

Edit2 :

i deleted Build and Devel

catkin_make

again ...

(more)
edit retag flag offensive close merge delete

Comments

So: what is your question? What did you try yourself, what didn't work and why?

gvdhoorn gravatar image gvdhoorn  ( 2014-07-31 08:14:21 -0600 )edit

I've updated your formatting a bit: use 4 spaces before lines that you want quoted as-is. '<code>' doesn't work too well.

gvdhoorn gravatar image gvdhoorn  ( 2014-08-01 04:58:04 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-07-31 09:21:20 -0600

gvdhoorn gravatar image

updated 2014-08-01 05:10:18 -0600

According to some posts on Stack Exchange (this one and this one), this can happen with newer versions of Android Studio / gradle / etc.

Apparently adding

sdk.dir=/path/to/your/sdk

to a file local.properties in your project should do the trick.


Edit & recap:

  1. you have Android Studio in: /home/user/opt/android-studio
  2. you have set ANDROID_HOME to: /home/user/opt/android-studio/sdk
  3. you have these Studio related directories on your path, in addition to your normal path (all on one line, I just copied your formatting):

    /home/user/opt/android-studio/sdk/tools:
    /home/user/opt/android-studio/sdk/platform-tools:
    /home/user/opt/android-studio/bin
    
  4. you can run adb in a terminal, and adb devices shows you your device (after you've connected it)

  5. you have a file called local.properties in both android_core and the android_extras project directories, with the following content:

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

Correct? If not, please update things to match.

Also, please edit PATH and ANDROID_HOME to only point to the actual location of the Android Studio (so /home/user/opt/android-studio/sdk), remove the entries that point to /opt/android-studio: you don't have it there, so no point in adding those. Also (but minor): your PATH includes paths like /home/user/home/user/opt/android-studio, remove those.

In a fresh terminal, please make sure the above is all true, remove the devel and build directories, and try catkin_make once more.

do i really have to unzip the android studio bundle in root/opt?

And no, you don't have to. I have Android Studio under $HOME/opt as well, and it works fine.

Additional question: which JDK did you install? I've been using Oracle Java 7u65 successfully.


Edit2:

installed android tools (adb) from ..

That should not have been necessary: adb is included in the Android Studio installation. If you've followed proper setup procedure for Android Studio, adb should already work.

I've hardcoded the variables ANDROID_HOME and PATH in .bashrc and opend an other terminal (that solved my problem)

I assumed you had your environment setup properly, but yes, you need these variables to be set in every terminal session you open.

catkin_make starts running with a lot of warnings

Those warnings are 'fine': it just tells you that some class files in jars distributed with rosjava that have been built with an older version of javac. You can ignore these for now.

and finally fails -> next error

This is a permission error. I don't quite get why it is trying to upload to the maven repo in /opt/ros/hydro/share, as I've always understood that it should do that to your devel directory in your workspace (at least, that is what it does for me). Is this the only project that does this, do the others get uploaded to your devel dir?

edit flag offensive delete link more

Comments

created a file local.properties with "sdk.dir=/home/user/opt/android-studio/sdk" -- still same error -- "sdk.dir=/opt/android-studio/sdk" -- still same error -- the path in my android sdk manager is "/home/user/opt/android-studio/sdk"

stefan gravatar image stefan  ( 2014-08-01 01:36:24 -0600 )edit

Where did you put the file? It has to go into the gradle project that you are building. And each project needs a copy of it.

gvdhoorn gravatar image gvdhoorn  ( 2014-08-01 01:49:50 -0600 )edit
0

answered 2014-07-31 10:12:01 -0600

Airuno2L gravatar image
The SDK directory '/opt/android-studio/sdk:/home/user/opt/android-studio/sdk' does not exist.

That doesn't look right, it looks like it's thinking that whole string is the directory path. I would try removing the /home/user... part of ANDROID_HOME. I think its a little weird to have a /opt directory under /home/user anyways, but I don't know much about that.

I'd try:

export ANDROID_HOME=/opt/android-studio/sdk

Then catkin_make again.

edit flag offensive delete link more

Comments

i added the second path, since i got the error message

stefan gravatar image stefan  ( 2014-08-01 01:36:21 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-31 05:58:27 -0600

Seen: 1,916 times

Last updated: Aug 01 '14