Slick Forums

Discuss the Slick 2D Library
It is currently Sat Feb 23, 2019 1:23 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Apr 24, 2012 12:34 pm 
Offline
Regular

Joined: Thu Sep 22, 2011 4:39 pm
Posts: 165
Location: Belgium
i'm deploying my app on android but it fails loading, it uses also slick sui,..
i think it fails here at org.mdes.slick.sui.Timer.getTime(Timer.java:249)
which uses the same statement as in the thread below:

return (Sys.getTime() * 1000) / Sys.getTimerResolution();

i think it should be solved by this thread but i can't seem to find a solution
viewtopic.php?t=3494

help :]

04-24 12:30:28.594: I/SLICK(657): Early loading of deferred resource due to req: resources/fonts/fW27_00.png
04-24 12:30:28.894: I/dalvikvm(657): Could not find method java.awt.Toolkit.getDefaultToolkit, referenced from method org.lwjgl.LinuxSysImplementation.<clinit>
04-24 12:30:28.904: W/dalvikvm(657): VFY: unable to resolve static method 7061: Ljava/awt/Toolkit;.getDefaultToolkit ()Ljava/awt/Toolkit;
04-24 12:30:28.924: D/dalvikvm(657): VFY: replacing opcode 0x71 at 0x0000
04-24 12:30:28.971: I/dalvikvm(657): Could not find method javax.swing.UIManager.getSystemLookAndFeelClassName, referenced from method org.lwjgl.J2SESysImplementation.alert
04-24 12:30:28.971: W/dalvikvm(657): VFY: unable to resolve static method 8189: Ljavax/swing/UIManager;.getSystemLookAndFeelClassName ()Ljava/lang/String;
04-24 12:30:28.976: D/dalvikvm(657): VFY: replacing opcode 0x71 at 0x0000
04-24 12:30:28.976: I/dalvikvm(657): Could not find method javax.swing.JOptionPane.showMessageDialog, referenced from method org.lwjgl.J2SESysImplementation.alert
04-24 12:30:28.976: W/dalvikvm(657): VFY: unable to resolve static method 8170: Ljavax/swing/JOptionPane;.showMessageDialog (Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V
04-24 12:30:28.984: D/dalvikvm(657): VFY: replacing opcode 0x71 at 0x0009
04-24 12:30:28.984: I/dalvikvm(657): Could not find method java.awt.Toolkit.getDefaultToolkit, referenced from method org.lwjgl.J2SESysImplementation.getClipboard
04-24 12:30:28.984: W/dalvikvm(657): VFY: unable to resolve static method 7061: Ljava/awt/Toolkit;.getDefaultToolkit ()Ljava/awt/Toolkit;
04-24 12:30:28.984: D/dalvikvm(657): VFY: replacing opcode 0x71 at 0x0001
04-24 12:30:28.995: W/dalvikvm(657): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lorg/lwjgl/LinuxSysImplementation;
04-24 12:30:28.995: W/dalvikvm(657): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lorg/lwjgl/Sys;
04-24 12:30:28.995: W/dalvikvm(657): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lorg/mdes/slick/sui/Sui;
04-24 12:30:29.264: E/SLICK(657): java.lang.ExceptionInInitializerError
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Component.getTheme(Component.java:924)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Component.<init>(Component.java:104)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Container.<init>(Container.java:45)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Label.<init>(Label.java:111)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Label.<init>(Label.java:82)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Label.<init>(Label.java:91)
04-24 12:30:29.264: E/SLICK(657): at hh.states.layout.TextLabel.<init>(TextLabel.java:16)
04-24 12:30:29.264: E/SLICK(657): at hh.states.layout.Achievement.<init>(Achievement.java:33)
04-24 12:30:29.264: E/SLICK(657): at hh.Config.loadResources(Config.java:201)
04-24 12:30:29.264: E/SLICK(657): at hh.Config.init(Config.java:125)
04-24 12:30:29.264: E/SLICK(657): at hh.states.SplashScreen.update(SplashScreen.java:42)
04-24 12:30:29.264: E/SLICK(657): at org.newdawn.slick.state.StateBasedGame.update(StateBasedGame.java:331)
04-24 12:30:29.264: E/SLICK(657): at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:574)
04-24 12:30:29.264: E/SLICK(657): at org.newdawn.slick.GDXGameContainer.render(GDXGameContainer.java:156)
04-24 12:30:29.264: E/SLICK(657): at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:406)
04-24 12:30:29.264: E/SLICK(657): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
04-24 12:30:29.264: E/SLICK(657): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
04-24 12:30:29.264: E/SLICK(657): Caused by: java.lang.ExceptionInInitializerError
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Timer.getTime(Timer.java:249)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Timer.<init>(Timer.java:33)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Timer.<init>(Timer.java:64)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.skin.simple.SimpleTextComponentAppearance.<init>(SimpleTextComponentAppearance.java:21)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.skin.simple.SimpleTextAreaAppearance.<init>(SimpleTextAreaAppearance.java:19)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.skin.simple.SimpleSkin.<init>(SimpleSkin.java:46)
04-24 12:30:29.264: E/SLICK(657): at org.mdes.slick.sui.Sui.<clinit>(Sui.java:35)
04-24 12:30:29.264: E/SLICK(657): ... 17 more
04-24 12:30:29.264: E/SLICK(657): Caused by: java.lang.ExceptionInInitializerError
04-24 12:30:29.264: E/SLICK(657): at org.lwjgl.Sys.createImplementation(Sys.java:113)
04-24 12:30:29.264: E/SLICK(657): at org.lwjgl.Sys.<clinit>(Sys.java:98)
04-24 12:30:29.264: E/SLICK(657): ... 24 more
04-24 12:30:29.264: E/SLICK(657): Caused by: java.lang.NoClassDefFoundError: java.awt.Toolkit
04-24 12:30:29.264: E/SLICK(657): at org.lwjgl.LinuxSysImplementation.<clinit>(LinuxSysImplementation.java:45)
04-24 12:30:29.264: E/SLICK(657): ... 26 more
04-24 12:30:29.284: E/SLICK(657): Failed to render/update
04-24 12:30:29.284: E/SLICK(657): org.newdawn.slick.SlickException: Game.update() failure - check the game code.


Top
 Profile  
 
PostPosted: Tue Apr 24, 2012 2:31 pm 
Offline

Joined: Tue May 03, 2011 10:38 pm
Posts: 32
This is a known issue that gets fixed with the new Animation class Mr Kenkron built. Here is my thread

There's two ways to fix this:

1. Rebuild the slick-ae.jar using the development build

or 2. Copy the Animation class into your source code.

I have issues with 1. because for some reason my build is being rejected (the prefered jre is jre6 for slick and Android). Mr Kenkron is also working on this fix, he should post in this thread when he completes the change to build.xml


Top
 Profile  
 
PostPosted: Tue Apr 24, 2012 3:11 pm 
Offline
Regular

Joined: Thu Sep 22, 2011 4:39 pm
Posts: 165
Location: Belgium
if i know the fix i can patch the slick sui also because i use my own tweaked slick ae build
because i've optimized it for the particle emmitters and so on

are you sure slick sui can be run on andriod? otherwise i need to change my implementation
because all my labels are linked to slick sui..

ok i see that this is the solution, i'll try to patch slick sui also, i'll keep you posted
System.nanoTime()/1000000;

<edit>
looks promesing but very slow, heap to 500 :)
Image

still some issues with the cursors, can i use cursors on android?

04-24 15:47:36.193: W/dalvikvm(680): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lorg/lwjgl/opengl/Display;
04-24 15:47:36.193: D/dalvikvm(680): Method.invoke() on bad class Lorg/lwjgl/opengl/Display; failed
04-24 15:47:36.203: I/SLICK(680): Chances are you cursor is too small for this platform
04-24 15:47:36.503: E/SLICK(680): Failed to load and apply SUI 'select' cursor.
04-24 15:47:36.503: E/SLICK(680): org.lwjgl.LWJGLException: java.lang.ExceptionInInitializerError
04-24 15:47:36.503: E/SLICK(680): at org.newdawn.slick.opengl.CursorLoader.getCursor(CursorLoader.java:77)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.skin.simple.SimpleSkin.tryCursor(SimpleSkin.java:100)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.skin.simple.SimpleSkin.install(SimpleSkin.java:83)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Sui.setSkin(Sui.java:170)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Sui.<clinit>(Sui.java:46)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Component.getTheme(Component.java:924)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Component.<init>(Component.java:104)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Container.<init>(Container.java:45)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Label.<init>(Label.java:111)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Label.<init>(Label.java:82)
04-24 15:47:36.503: E/SLICK(680): at org.mdes.slick.sui.Label.<init>(Label.java:91)
04-24 15:47:36.503: E/SLICK(680): at hh.states.layout.TextLabel.<init>(TextLabel.java:16)
04-24 15:47:36.503: E/SLICK(680): at hh.states.layout.Achievement.<init>(Achievement.java:33)
04-24 15:47:36.503: E/SLICK(680): at hh.Config.loadResources(Config.java:201)
04-24 15:47:36.503: E/SLICK(680): at hh.Config.init(Config.java:125)
04-24 15:47:36.503: E/SLICK(680): at hh.states.SplashScreen.update(SplashScreen.java:42)
04-24 15:47:36.503: E/SLICK(680): at org.newdawn.slick.state.StateBasedGame.update(StateBasedGame.java:331)
04-24 15:47:36.503: E/SLICK(680): at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:574)
04-24 15:47:36.503: E/SLICK(680): at org.newdawn.slick.GDXGameContainer.render(GDXGameContainer.java:156)
04-24 15:47:36.503: E/SLICK(680): at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:406)
04-24 15:47:36.503: E/SLICK(680): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
04-24 15:47:36.503: E/SLICK(680): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
04-24 15:47:36.503: E/SLICK(680): Caused by: java.lang.ExceptionInInitializerError
04-24 15:47:36.503: E/SLICK(680): at java.lang.reflect.Method.invokeNative(Native Method)
04-24 15:47:36.503: E/SLICK(680): at java.lang.reflect.Method.invoke(Method.java:511)
04-24 15:47:36.503: E/SLICK(680): at org.lwjgl.input.OpenGLPackageAccess$2.run(OpenGLPackageAccess.java:73)
04-24 15:47:36.503: E/SLICK(680): at org.lwjgl.input.OpenGLPackageAccess$2.run(OpenGLPackageAccess.java:69)
04-24 15:47:36.503: E/SLICK(680): at java.security.AccessController.doPrivileged(AccessController.java:60)
04-24 15:47:36.503: E/SLICK(680): at org.lwjgl.input.OpenGLPackageAccess.createImplementation(OpenGLPackageAccess.java:69)
04-24 15:47:36.503: E/SLICK(680): at org.lwjgl.input.Cursor.getCapabilities(Cursor.java:154)
04-24 15:47:36.503: E/SLICK(680): at org.lwjgl.input.Cursor.<init>(Cursor.java:87)
04-24 15:47:36.503: E/SLICK(680): at org.newdawn.slick.opengl.CursorLoader.getCursor(CursorLoader.java:74)
04-24 15:47:36.503: E/SLICK(680): ... 21 more
04-24 15:47:36.503: E/SLICK(680): Caused by: java.lang.NoClassDefFoundError: org.lwjgl.opengl.Display$2
04-24 15:47:36.503: E/SLICK(680): at org.lwjgl.opengl.Display.<clinit>(Display.java:121)
04-24 15:47:36.503: E/SLICK(680): ... 30 more
04-24 15:47:36.503: E/SLICK(680): Requesting: resources/skin/shared/verdana.png
04-24 15:47:36.513: E/SLICK(680): Requesting: resources/skin/shared/verdana.fnt
04-24 15:47:36.513: E/SLICK(680): Fail: Unsupported: glGenLists
04-24 15:47:36.533: I/SLICK(680): Early loading of deferred resource due to req: resources/skin/shared/verdana.png
04-24 15:47:36.713: E/SLICK(680): Requesting: resources/images/mouse/cursor_seek.png
04-24 15:47:36.873: I/dalvikvm(680): Rejecting re-init on previously-failed class Lorg/lwjgl/opengl/Display; v=0x0
04-24 15:47:36.873: D/dalvikvm(680): Method.invoke() on bad class Lorg/lwjgl/opengl/Display; failed
04-24 15:47:36.873: I/SLICK(680): Chances are you cursor is too small for this platform


Top
 Profile  
 
PostPosted: Tue Apr 24, 2012 4:50 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
You probably shouldn't rely on Slick-SUI for anything these days -- it was programmed a long time ago, when I was still new to Java/OpenGL. Labels, buttons, and even text fields are relatively easy to roll yourself, and since you're using Android you'll want to maximize performance (i.e. pack all images into a sprite sheet to reduce texture binds, etc).


Top
 Profile  
 
PostPosted: Tue Apr 24, 2012 7:37 pm 
Offline
Regular

Joined: Thu Sep 22, 2011 4:39 pm
Posts: 165
Location: Belgium
hey davedes, well everything is already packed for slick desktop so that's ok
but i didn't find any alternative for listeners on labels or textfields? (which work on both android and desktop)
certainly for fields that can center text or align text

cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group