Java build error when targeting android api 10

Just thought I would pass this along. This is from the latest mercurial build targeting android api 10.

-compile:
[javac] Compiling 1 source file to /home/entelin/edensharbor2/bin/classes
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:1067: error: cannot find symbol
[javac] class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
[javac] ^
[javac] symbol: class OnGenericMotionListener
[javac] location: class View
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:546: error: cannot find symbol
[javac] setOnGenericMotionListener(new SDLGenericMotionListener_API12());
[javac] ^
[javac] symbol: method setOnGenericMotionListener(SDLGenericMotionListener_API12)
[javac] location: class SDLSurface
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:952: error: cannot find symbol
[javac] return arg0.getAxis() - arg1.getAxis();
[javac] ^
[javac] symbol: method getAxis()
[javac] location: variable arg0 of type MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:952: error: cannot find symbol
[javac] return arg0.getAxis() - arg1.getAxis();
[javac] ^
[javac] symbol: method getAxis()
[javac] location: variable arg1 of type MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:976: error: cannot find symbol
[javac] if( (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
[javac] ^
[javac] symbol: variable SOURCE_CLASS_JOYSTICK
[javac] location: class InputDevice
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:982: error: cannot find symbol
[javac] List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();
[javac] ^
[javac] symbol: method getMotionRanges()
[javac] location: variable joystickDevice of type InputDevice
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:985: error: cannot find symbol
[javac] if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 ) {
[javac] ^
[javac] symbol: method getSource()
[javac] location: variable range of type MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:985: error: cannot find symbol
[javac] if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 ) {
[javac] ^
[javac] symbol: variable SOURCE_CLASS_JOYSTICK
[javac] location: class InputDevice
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:986: error: cannot find symbol
[javac] if (range.getAxis() == MotionEvent.AXIS_HAT_X ||
[javac] ^
[javac] symbol: method getAxis()
[javac] location: variable range of type MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:986: error: cannot find symbol
[javac] if (range.getAxis() == MotionEvent.AXIS_HAT_X ||
[javac] ^
[javac] symbol: variable AXIS_HAT_X
[javac] location: class MotionEvent
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:987: error: cannot find symbol
[javac] range.getAxis() == MotionEvent.AXIS_HAT_Y) {
[javac] ^
[javac] symbol: method getAxis()
[javac] location: variable range of type MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:987: error: cannot find symbol
[javac] range.getAxis() == MotionEvent.AXIS_HAT_Y) {
[javac] ^
[javac] symbol: variable AXIS_HAT_Y
[javac] location: class MotionEvent
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:1039: error: cannot find symbol
[javac] if ( (event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
[javac] ^
[javac] symbol: variable SOURCE_JOYSTICK
[javac] location: class InputDevice
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:1049: error: cannot find symbol
[javac] float value = ( event.getAxisValue( range.getAxis(), actionPointerIndex) - range.getMin() ) / range.getRange() * 2.0f - 1.0f;
[javac] ^
[javac] symbol: method getAxis()
[javac] location: variable range of type MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:1053: error: cannot find symbol
[javac] int hatX = Math.round(event.getAxisValue( joystick.hats.get(i).getAxis(), actionPointerIndex ) );
[javac] ^
[javac] symbol: method getAxis()
[javac] location: class MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:1054: error: cannot find symbol
[javac] int hatY = Math.round(event.getAxisValue( joystick.hats.get(i+1).getAxis(), actionPointerIndex ) );
[javac] ^
[javac] symbol: method getAxis()
[javac] location: class MotionRange
[javac] /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java:1070: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] Note: /home/entelin/edensharbor2/src/org/libsdl/app/SDLActivity.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 17 errors

BUILD FAILED
/home/entelin/android-sdk-linux/tools/ant/build.xml:720: The following error occurred while executing this line:
/home/entelin/android-sdk-linux/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

btw, I bypassed the issue personally by just commenting out all the API12 labeled functions. I just wanted to let people know it doesn’t build as is on api10 unless I missed some define I need to set somewhere…

Which SDK version are you using?

2014-05-04 5:36 GMT-03:00 Entelin :> btw, I bypassed the issue personally by just commenting out all the

API12 labeled functions. I just wanted to let people know it doesn’t build
as is on api10 unless I missed some define I need to set somewhere…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

Hi,

as far as I understand, you don’t build against API10. You should have your
minimum SDK version set to 10 and your target SDK version set to 12. The
code compiles (for API12) and runs on anything >= API10 (the API12 calls are
only used when this API level is detected).

Works for me at least.

Regards,

Daniel

---------- P?vodn? zpr?va ----------
Od: Entelin
Komu: sdl at lists.libsdl.org
Datum: 7. 5. 2014 18:47:27
P?edm?t: Re: [SDL] Java build error when targeting android api 10

"

btw, I bypassed the issue personally by just commenting out all the API12
labeled functions. I just wanted to let people know it doesn’t build as is
on api10 unless I missed some define I need to set somewhere…

"