We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everybody!
I just reinstalled android sdk tools and I followed the instruction found in this link http://wiki.processing.org/w/Android#Instructions to make processing work with android..
I said "reinstalled" because over the last year I had (silly) reasons to install/uninstall android sdk and java. depending on some tutorials..
So today I decided to follow a tutorial on processing where the code has just a few lines..
#############################
    Accelerometer accel;
    void setup(){
    accel = new Accelerometer();
    }
    void draw(){
      println(accel.getX());
    }
#############################
It is supposed that I do not need to do anything in order to make accelerometer work (like import or something like that) but when I try to run it (directly on my device Nexus 5) it will produce the following error..
###########################
BUILD FAILED
E:\Users\john\AppData\Local\Android\android-sdk\tools\ant\build.xml:720: The following error occurred while executing this line:
E:\Users\john\AppData\Local\Android\android-sdk\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.
###########################
Any idea please? I know I am doing something wrong but I cannot figure out what..
Thanks!
Here is the full message from Processing
###########################################################
-set-mode-check:
-set-debug-files:
-check-env:
Android SDK Tools Revision 22.6.2
Installed at E:\Users\john\AppData\Local\Android\android-sdk
-setup:
     [echo] Project Name: sketch_140413b
Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
Using latest Build Tools: 19.0.3
     [echo] Resolving Build Target for sketch_140413b...
Project Target:   Android 2.3.3
API level:        10
WARNING: Attribute minSdkVersion in AndroidManifest.xml (19) is higher than the project target API level (10)
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin\res
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin\rsObj
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin\rsLibs
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\gen
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin\classes
    [mkdir] Created dir: C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin\dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for sketch_140413b...
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 C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\bin\classes
    [javac] C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\src\processing\test\sketch_140413b\sketch_140413b.java:19: error: cannot find symbol
    [javac] Accelerometer accel;
    [javac] ^
    [javac]   symbol:   class Accelerometer
    [javac]   location: class sketch_140413b
    [javac] C:\Users\john\AppData\Local\Temp\android8608167387789961886sketch\src\processing\test\sketch_140413b\sketch_140413b.java:21: error: cannot find symbol
    [javac] accel = new Accelerometer();
    [javac]             ^
    [javac]   symbol:   class Accelerometer
    [javac]   location: class sketch_140413b
    [javac] 2 errors
BUILD FAILED
E:\Users\john\AppData\Local\Android\android-sdk\tools\ant\build.xml:720: The following error occurred while executing this line:
E:\Users\john\AppData\Local\Android\android-sdk\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.
###########################################################
            
Answers
It looks like you're missing a class called
Accelerometer. I don't know where this class would come from other than an example, such as one included with the Processing distribution, or perhaps with Ketai. There is a Processing example called "Accelerometer" (in the "Sensors" folder) that includes anAccelerometerManagerclass.