Build Error 720

The simple project from the learning section doesn't build.

Processing 2.2.1, OSX 10.9.3

Wiki steps (.bash_profile) are followed http://wiki.processing.org/w/Android#Mac_Users

-set-mode-check:

-set-debug-files:

-check-env:
Android SDK Tools Revision 22.6.3
Installed at /Developer/AndroidSDK

-setup:
     [echo] Project Name: sketch_140527a
Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
Using latest Build Tools: 18.1.1
     [echo] Resolving Build Target for sketch_140527a...
Project Target:   Android 2.3.3
API level:        10
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin/res
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin/rsObj
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin/rsLibs
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/gen
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin/classes
    [mkdir] Created dir: /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin/dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for sketch_140527a...
Library dependencies:
No Libraries

------------------
API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 3 source files to /var/folders/q7/zk_87gvn1z3cyzkr4q6s09_c0000gn/T/android698411884173285614sketch/bin/classes
    [javac] Unable to locate an executable at "/Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/javac" (-1)

BUILD FAILED
/Developer/AndroidSDK/tools/ant/build.xml:720: The following error occurred while executing this line:
/Developer/AndroidSDK/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 4 seconds

Answers

  • Answer ✓

    Ant is looking for the Java compiler (javac) at the following path:

    /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/javac
    

    Does this file exist? If not, you may need to mess with paths or create a symbolic link to another JDK location. I don't have much (any) experience with setting up Android on a Mac, but I have heard that symbolic links have worked for other people.

  • Good, I was only focussed on the red lines. The path exist but the directory only contains java. Not javac.

    Does that mean that Processing 2.2.1 is broken for Android on Mac. Where can I get javac ?

  • Ok, it's an known and still open issue on Github: https://github.com/processing/processing-android/issues/60.

    I tried the offered "solution" but this gives me another error.

    Solution: - Go to Terminal. - cd /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_45.jdk/Contents/ Home/jre/bin - run: ln -s /Library/Java/Home/bin/javac javac

    Run on Device gives the error below:

    BUILD FAILED
    /Developer/AndroidSDK/tools/ant/build.xml:962: The following error occurred while executing this line:
    /Developer/AndroidSDK/tools/ant/build.xml:973: The following error occurred while executing this line:
    /Developer/AndroidSDK/tools/ant/build.xml:313: com.android.sdklib.build.ApkCreationException: Failed to create key: Cannot run program "/Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/keytool": error=2, No such file or directory
    JAVA_HOME is set to: /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre
    Update it if necessary, or manually execute the following command:
    /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/keytool -genkey -alias AndroidDebugKey -keyalg RSA -dname "CN=Android Debug,O=Android,C=US" -validity 10950 -keypass android -keystore /Users/kasperkamperman/.android/debug.keystore -storepass android
        at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:300)
    
    • copy-paste this whole line from the error in the still open Terminal (below it has my own user directory "kasperkamperman", but this is unique for your own system)

    • run: keytool -genkey -alias AndroidDebugKey -keyalg RSA -dname "CN=Android Debug,O=Android,C=US" -validity 10950 -keypass android -keystore /Users/kasperkamperman/.android/debug.keystore -storepass android

    Run on Device works (my Samsung Galaxy II)!

    Run in Emulator keeps giving me errors, but that could be caused by something else.

  • Running in different Emulators (emulator is open and started) fails with this kind of error (the number behind Thread is all the time different): Exception in thread "Thread-234" java.lang.NoSuchMethodError: processing.app.Base.showWarningTiered(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)

    Solution can be found over here: http://forum.processing.org/two/discussion/3093/emulator-in-android-mode-does-not-work/

  • creating symlink works for me, too (Processing 2.2.1 / Android SDK 19.0 / OSX):

    go to the folder, where processing is searching for the javac file in terminal. mine is:

    /Volumes/Macintosh HD/Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/

    then, create a symlink here, like the following:

    ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/javac javac

    change paths to fit your environment. once symlink is created, error gone at least for me. hope that helps

  • edited August 2014

    I needed to do all steps again, because of a new system install. It stays difficult. Just to help others:

    Creating the symlink to javac (in the path of stc it couldn't be found):

    theproce55.tumblr.com/post/82883027743/fixing-android-development-in-processing-2-1-1

    ln -s /Library/Java/Home/bin/javac javac

    I got a permission denied and found out that I didn't had root access. Solution: azchipka.thechipkahouse.com/enabling-root-user-mavericks-mac-os-10-9/7567/

    Surf again to the right directory in the terminal (in my case): cd /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/ ln -s /Library/Java/Home/bin/javac javac

    Dont' forget the keytool (see post above).

    Also don't forget to create an emulator: forum.processing.org/two/discussion/3093/emulator-in-android-mode-does-not-work/#Item_7

Sign In or Register to comment.