Why are Android API imports causing compiler errors?
in
Android Processing
•
3 years ago
Android Processing has been working well for me so far -- I've managed to compile and run simple Processing sketches through the Emulator. Very straightforward.
Now I'm trying to dig a bit deeper and connect with the Android API -- specifically GPS-related functions.
I started off with some example code from
http://developer.android.com , but no matter what I do, I cannot make it compile. The snippet below has almost everything commented out. If I comment out "import android.location;" it will compile.
- import android.location;
- //import android.content;
- //LocationManager locationManager;
- //LocationListener locationListener;
- void setup ()
- {
- // locationManager = (LocationManager) this.getSystemService (Context.LOCATION_SERVICE);
- noLoop();
- }
- //void makeUseOfNewLocation (/*Location location*/)
- //{
- // println ("New location");
- //}
- void draw ()
- {
- }
The messages I get are cryptic:
BUILD FAILED
C:\android-sdk-windows\platforms\android-7\ant\ant_rules_r2.xml:255: Compile failed; see the compiler error output for details.
Total time: 1 second
C:\android-sdk-windows\platforms\android-7\ant\ant_rules_r2.xml:255: Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:999)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:820)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at processing.app.tools.android.Build.antBuild(Unknown Source)
at processing.app.tools.android.AndroidMode.runSketchOnDevice(Unknown Source)
at processing.app.tools.android.AndroidMode.access$600(Unknown Source)
at processing.app.tools.android.AndroidMode$RunHandler.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
My questions are:
1. Where is the compile error output directed? Is there a file I can examine?
2. Am I missing something obvious, like perhaps needing to manually set the path to the SDK? The first time I ran Android mode, the Processing IDE ask me to locate the SDK. When I started having these problems, I shutdown the IDE and restarted it. No complaints about the SDK location this time.
thank you for any assistance you may be able to offer!
Michael
1