rosjava / rosjava_build_tools

Build tools for rosjava repositories.
Other
2 stars 35 forks source link

catkin_create_android_project error #31

Open hungbui-io opened 7 years ago

hungbui-io commented 7 years ago

I'm having an issue when create an android project. It shows the following error:

`~/Workspaces/ros/arduino_p1/src/p1_remote$ catkin_create_android_project -t 25 -p lan.robonet.p1_remote.remote remote

Creating android project Name : remote Target Ver: 25 Java Name : lan.robonet.p1_remote.remote Activity : Remote

Command: ['android', 'create', 'project', '-n', 'remote', '-p', '/home/randy/Workspaces/ros/arduino_p1/src/p1_remote/remote', '-k', 'lan.robonet.p1_remote.remote', '-t', 'android-25', '-a', 'Remote'] The android command is no longer available. For manual SDK and AVD management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager Error [error] init() takes at least 3 arguments (2 given) : <type 'exceptions.TypeError'>`

Any idea how to solve it would be greatly appreciated!

adamantivm commented 7 years ago

@hungbv11 which version of the Android SDK are you using?

adamantivm commented 7 years ago

@hungbv11 it seems that starting with Android SDK Tools 25.3.1, the android command is no longer available and that broke the catin_create_android_package command. Perhaps you're using this version or higher inadvertently? You can check by doing which android. JFYI, the android command should be in $SDK_LOCATION/tools/android. You could check if the right SDK is in your PATH environment variable, to help catkin_create_android_package to find the proper android command.

Another (worse) workaround is to try to downgrade your Android SDK Tools to lower than 25.3.1.

Finally, you could create the android package manually, by copying another existing example such as rosjava_extras

I hope that helps. Meanwhile, I'll add an issue to remember to update the rosjava build tools to this Android SDK change.

bochen87 commented 7 years ago

Hi @adamantivm I'm also trying to create a new android app and face the same issues. Would it be possible to give a bit more detailed instructions on how to clone https://github.com/rosjava/android_extras in order to build my own ros Android app?

gongyue666 commented 5 years ago

hi, when I run "catkin_create_android_pkg androidpkg1 android_core, rosjava_core, std_msgs", I get the warning Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. and then when I run catkin_create_android_project androidp1, I get error blow: Creating android project Name : androidp1 Target Ver: 15 Java Name : com.github.rosjava.android.androidp1 Activity : Androidp1

Command: ['android', 'create', 'project', '-n', 'androidp1', '-p', '/home/gy/myandroid/androidpkg1/androidp1', '-k', 'com.github.rosjava.android.androidp1', '-t', 'android-15', '-a', 'Androidp1'] OS error[Errno 2] No such file or directory [error] : <type 'exceptions.OSError'> The Target Ver is 15, but it should be 25 as others do.where is the bug?does the warning caused it ?

jubeira commented 5 years ago

The problem is not the deprecated Gradle features; we are using Gradle 4.10 for every repository right now. The cause of the issue is in this comment: https://github.com/rosjava/rosjava_build_tools/issues/31#issuecomment-311448224; Google deprecated the tool that allowed this command to work at some point in the past.

See https://github.com/rosjava/rosjava_build_tools/issues/32 and https://github.com/rosjava/rosjava_build_tools/issues/32#issuecomment-338287796 for a workaround.

gongyue666 commented 5 years ago

Hi, I replace the sdk tools in Android Studio, now I see the sdk tool version is down to 25.2.5, but still have the error. android sdk tool should I do something for the rosjava?

gongyue666 commented 5 years ago

hi, I sloved the problem, it caused by the environment var include the sdk tools path, thx very much.