merlinvn / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

ControlP5 crash on android 4.1 & 4.0 #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
While processing sketches (i.e. non controlP5) build & run correctly on my 
target device (jelly-bean 4.1, nexus 7), neither of the
controllP5 examples work.

Building from within the Processing IDE completes without problem, but as soon 
as the app launches on the device (and I have tried a second device as well, no 
success), it crashes with the following output ...

Android SDK Tools Revision 20.0.3
Installed at D:Umaesschpandroid-sdks
Project Type: Application
Project Target:   Android 2.3.3
API level:        10
Library dependencies:
No Libraries

------------------
API<=15: Adding annotations.jar to the classpath.
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
No AIDL files to compile.
No RenderScript files to compile.
Generating resource IDs...
Generating BuildConfig class.
Converting compiled files and external libraries into 
d:UmaesschpAppDataLocalTempandroid4218929151269187915sketchinclasses.dex...
Creating full resource package...
Current build type is different than previous build: forced apkbuilder run.
Creating ControlP5checkBox-debug-unaligned.apk and signing it with a debug 
key...
Running zip align on final apk...

FATAL EXCEPTION: Animation Thread
java.lang.NoSuchMethodError: processing.core.PApplet.registerMethod
    at controlP5.ControlWindow.init(Unknown Source)
    at controlP5.ControlWindow.<init>(Unknown Source)
    at controlP5.ControlP5.init(Unknown Source)
    at controlP5.ControlP5.<init>(Unknown Source)
    at processing.test.controlp5checkbox.ControlP5checkBox.setup(ControlP5checkBox.java:44)
    at processing.core.PApplet.handleDraw(PApplet.java:1855)
    at processing.core.PGraphicsAndroid2D.requestDraw(PGraphicsAndroid2D.java:161)
    at processing.core.PApplet.run(PApplet.java:1746)
    at java.lang.Thread.run(Thread.java:856)

Processing version = 2.0b3, controllP5 = 2.0.1, SDK-tools = 20.0.3 and 
installed API levels are 16 & 10.

Original issue reported on code.google.com by AkitaIn...@gmail.com on 7 Oct 2012 at 1:03

GoogleCodeExporter commented 8 years ago
Cleaning up my post according to the template.

What steps will reproduce the problem?
1. trying to run a ControlP5 example (I used ControlP5button) on android 4.1 
(4.0 tested as well)

What is the expected output? What do you see instead?

Android SDK Tools Revision 20.0.3
Installed at D:\Users\maesschp\android-sdks
Project Type: Application
Project Target:   Android 2.3.3
API level:        10
Library dependencies:
No Libraries

------------------
API<=15: Adding annotations.jar to the classpath.
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
No AIDL files to compile.
No RenderScript files to compile.
Generating resource IDs...
Generating BuildConfig class.
Converting compiled files and external libraries into 
d:\Users\maesschp\AppData\Local\Temp\android975276827861431615sketch\bin\classes
.dex...
Creating full resource package...
Current build type is different than previous build: forced apkbuilder run.
Creating ControlP5button-debug-unaligned.apk and signing it with a debug key...
Running zip align on final apk...
FATAL EXCEPTION: Animation Thread
java.lang.NoSuchMethodError: processing.core.PApplet.registerMethod
    at controlP5.ControlWindow.init(Unknown Source)
    at controlP5.ControlWindow.<init>(Unknown Source)
    at controlP5.ControlP5.init(Unknown Source)
    at controlP5.ControlP5.<init>(Unknown Source)
    at processing.test.controlp5button.ControlP5button.setup(ControlP5button.java:43)
    at processing.core.PApplet.handleDraw(PApplet.java:1855)
    at processing.core.PGraphicsAndroid2D.requestDraw(PGraphicsAndroid2D.java:161)
    at processing.core.PApplet.run(PApplet.java:1746)
    at java.lang.Thread.run(Thread.java:856)

What version of the product are you using? On what operating system?

Processing version = 2.0b3, controllP5 = 2.0.1, SDK-tools = 20.0.3 and 
installed API levels are 16 & 10. Windows 64bit.

Original comment by AkitaIn...@gmail.com on 7 Oct 2012 at 1:52

GoogleCodeExporter commented 8 years ago
Hi, I can't confirm the crash you encounter for processing 2.0b3, controlP5 
2.0.1 on osx running a sketch as java application nor as an android application 
on my android devices (nexus, samsung tablet).

i suspect you are running an older version of processing or there is a conflict 
with the windows version of processing 2.0b3

find below a test sketch to test the registerMethod implementation, runs 
without exception with my setup for both java and android mode (note: on 
android the mouseEvent method is not recognized by processing's core, hence 
will not be called).

void setup() {
  Test t = new Test();
  registerMethod("draw", t);
  registerMethod("keyEvent", t);
  registerMethod("mouseEvent", t);
}

void draw() {

}

public class Test {

  public void draw() {
    println("drawing");
  }

  public void keyEvent(processing.event.KeyEvent ke) {
    println("keyEvent "+ke);
    background(255);
  }

  public void mouseEvent(processing.event.MouseEvent ke) {
    println("mouseEvent "+ke.getAction());
    if(ke.getAction()==processing.event.MouseEvent.PRESSED) {
      background(255,0,0);
    } else if(ke.getAction()==processing.event.MouseEvent.RELEASED) {
      background(0);
    }
  }
}

Original comment by soj...@gmail.com on 8 Oct 2012 at 12:44

GoogleCodeExporter commented 8 years ago
Hi,

Thanks for your prompt feedback ...

The code snippet you provided runs fine in Java, but doesn't build for android.
Another issue here is (just to mention it, I saw it surface in previous 
issue-tickets) that there's no details/highlight of the error within the 
processing IDE .. so, not sure what is causing the build-error here.

Android SDK Tools Revision 20.0.3
Installed at D:\Users\maesschp\android-sdks
Project Type: Application
Project Target:   Android 2.3.3
API level:        10
Library dependencies:
No Libraries

------------------
API<=15: Adding annotations.jar to the classpath.
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
No AIDL files to compile.
No RenderScript files to compile.
Generating resource IDs...
Generating BuildConfig class.

BUILD FAILED
D:\Users\maesschp\android-sdks\tools\ant\build.xml:679: The following error 
occurred while executing this line:
D:\Users\maesschp\android-sdks\tools\ant\build.xml:692: Compile failed; see the 
compiler error output for details.

Original comment by AkitaIn...@gmail.com on 8 Oct 2012 at 4:36

GoogleCodeExporter commented 8 years ago
Hi again, made a quick retest (should have done this earlier, sorry) with 
Processing 2.0b3 32-bit version (I previously used the 64-bit version on a 
64-bit Win 7 platform) and the Controlp5 examples build and run fine now. I'll 
post the info on the processing forum as well.
Thanks again & best regards.
-P

Original comment by AkitaIn...@gmail.com on 8 Oct 2012 at 4:41

GoogleCodeExporter commented 8 years ago
ok, thanks. good to know that 32-bit and 64-bit behave differently with 
processing 2.0b3 on windows. closing the issue.

Original comment by soj...@gmail.com on 8 Oct 2012 at 11:19