Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

catkin_create_android_project error #31

Open
hungbui-io opened this issue Jun 27, 2017 · 7 comments
Open

catkin_create_android_project error #31

hungbui-io opened this issue Jun 27, 2017 · 7 comments
Labels

Comments

@hungbui-io
Copy link

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
Copy link
Contributor

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

@adamantivm
Copy link
Contributor

adamantivm commented Jun 27, 2017

@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
Copy link

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
Copy link

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
Copy link

jubeira commented Feb 20, 2019

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: #31 (comment); Google deprecated the tool that allowed this command to work at some point in the past.

See #32 and #32 (comment) for a workaround.

@gongyue666
Copy link

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants