Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run program "keytool" #254

Open
nclavaud opened this issue Oct 9, 2016 · 5 comments
Open

Cannot run program "keytool" #254

nclavaud opened this issue Oct 9, 2016 · 5 comments

Comments

@nclavaud
Copy link

nclavaud commented Oct 9, 2016

I'm running Processing 3.2.1 on Ubuntu 16.04.1 and I have installed Android mode 3.0.1 using the Contribution Manager. I have been prompted to install the Android SDK and I end up with Android SDK 6.0 (23) installed.

When trying to run the Getting started tutorial app on my device, I get the build error below, complaining file java/bin/keytool cannot be found.

BUILD FAILED
/home/processing/sketchbook/modes/AndroidMode/sdk/tools/ant/build.xml:958: The following error occurred while executing this line:
/home/processing/sketchbook/modes/AndroidMode/sdk/tools/ant/build.xml:969: The following error occurred while executing this line:
/home/processing/sketchbook/modes/AndroidMode/sdk/tools/ant/build.xml:312: com.android.sdklib.build.ApkCreationException: Failed to create key: Cannot run program "/home/processing/processing-3.2.1/java/bin/keytool": error=2, No such file or directory
JAVA_HOME is set to: /home/processing/processing-3.2.1/java
Update it if necessary, or manually execute the following command:
/home/processing/processing-3.2.1/java/bin/keytool -genkey -alias AndroidDebugKey -keyalg RSA -dname "CN=Android Debug,O=Android,C=US" -validity 10950 -keypass android -keystore /home/processing/.android/debug.keystore -storepass android
    at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:300)
    ...
    at processing.mode.android.AndroidEditor$16.run(AndroidEditor.java:553)

Indeed the file does not exist on my machine.

Did I miss something?

@nclavaud
Copy link
Author

Actually the keytool executable is available at /usr/bin/keytool on my machine.

$ whereis keytool
keytool: /usr/bin/keytool /usr/share/man/man1/keytool.1.gz

I could alias it, and managed to build the example application succesfully.

$ ln -s /usr/bin/keytool /home/processing/processing-3.2.1/java/bin/keytool

This step is not documented. Should we document it in Getting started tutorial?

@codeanticode codeanticode self-assigned this Oct 12, 2016
@codeanticode
Copy link
Member

@nclavaud thanks for your report, and the workaround. The mode should not try to run a missing keytool binary though. Will look into it!

@pierrep
Copy link

pierrep commented Oct 16, 2016

I have experienced this on Ubuntu 16.04 as well. I had to install the java SDK though to get access to the key tool and perform the above workaround.

@chepecarlos
Copy link

actually we have the same issue with linux mint 18 64 bits, and where can i'm gona donate for processing for android

@codeanticode codeanticode added this to the 3.0.2 bugfix release milestone Dec 29, 2016
@codeanticode
Copy link
Member

Looks like this is due to an omission in Processing's build file, which is removing keytool on Windows and Linux https://github.com/processing/processing/issues/3288

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

No branches or pull requests

4 participants