LWUIT midlet does not work when converted to apk

84 views
Skip to first unread message

amit gurnani

unread,
Mar 23, 2012, 7:31:56 AM3/23/12
to microemula...@googlegroups.com
Hi,
I have converted an application build using LWUIT 1.4 to .apk. Used Micro-emulator for the same.
On executing the application in android emulator. Getting an error Application Stopped unexpectedly.

Below is the Log
"V/MicroEmulator(  417): implementation registered [org.microemu.cldc.file.FileSy
stem]
V/MicroEmulator(  417):
E/dalvikvm(  417): Could not find class 'javax.microedition.media.Player', refer
enced from method com.sun.lwuit.impl.midp.GameCanvasImplementation.createVideoCo
mponent
W/dalvikvm(  417): VFY: unable to resolve check-cast 570 (Ljavax/microedition/me
dia/Player;) in Lcom/sun/lwuit/impl/midp/GameCanvasImplementation;
D/dalvikvm(  417): VFY: replacing opcode 0x1f at 0x0001
D/dalvikvm(  417): VFY: dead code 0x0003-0017 in Lcom/sun/lwuit/impl/midp/GameCa
nvasImplementation;.createVideoComponent (Ljava/lang/Object;)Ljava/lang/Object;
E/dalvikvm(  417): Could not find class 'javax.microedition.media.Player', refer
enced from method com.sun.lwuit.impl.midp.GameCanvasImplementation.getMediaTime
W/dalvikvm(  417): VFY: unable to resolve check-cast 570 (Ljavax/microedition/me
dia/Player;) in Lcom/sun/lwuit/impl/midp/GameCanvasImplementation;
D/dalvikvm(  417): VFY: replacing opcode 0x1f at 0x0000
D/dalvikvm(  417): VFY: dead code 0x0002-0006 in Lcom/sun/lwuit/impl/midp/GameCa
nvasImplementation;.getMediaTime (Ljava/lang/Object;)J
E/dalvikvm(  417): Could not find class 'javax.microedition.media.Player', refer
enced from method com.sun.lwuit.impl.midp.GameCanvasImplementation.getVideoContr
ol
W/dalvikvm(  417): VFY: unable to resolve check-cast 570 (Ljavax/microedition/me
dia/Player;) in Lcom/sun/lwuit/impl/midp/GameCanvasImplementation;
D/dalvikvm(  417): VFY: replacing opcode 0x1f at 0x0000
D/dalvikvm(  417): VFY: dead code 0x0002-0010 in Lcom/sun/lwuit/impl/midp/GameCa
nvasImplementation;.getVideoControl (Ljava/lang/Object;)Ljava/lang/Object;
E/dalvikvm(  417): Could not find class 'javax.microedition.media.control.VideoC
ontrol', referenced from method com.sun.lwuit.impl.midp.GameCanvasImplementation
.getVideoHeight
W/dalvikvm(  417): VFY: unable to resolve check-cast 571 (Ljavax/microedition/me
dia/control/VideoControl;) in Lcom/sun/lwuit/impl/midp/GameCanvasImplementation;

D/dalvikvm(  417): VFY: replacing opcode 0x1f at 0x0000
D/dalvikvm(  417): VFY: dead code 0x0002-0006 in Lcom/sun/lwuit/impl/midp/GameCa
nvasImplementation;.getVideoHeight (Ljava/lang/Object;)I
E/dalvikvm(  417): Could not find class 'javax.microedition.media.control.VideoC
ontrol', referenced from method com.sun.lwuit.impl.midp.GameCanvasImplementation
.getVideoWidth
W/dalvikvm(  417): VFY: unable to resolve check-cast 571 (Ljavax/microedition/me
dia/control/VideoControl;) in Lcom/sun/lwuit/impl/midp/GameCanvasImplementation;

D/dalvikvm(  417): VFY: replacing opcode 0x1f at 0x0000
D/dalvikvm(  417): VFY: dead code 0x0002-0006 in Lcom/sun/lwuit/impl/midp/GameCa
nvasImplementation;.getVideoWidth (Ljava/lang/Object;)I
E/dalvikvm(  417): Could not find class 'javax.microedition.media.control.VideoC
ontrol', referenced from method com.sun.lwuit.impl.midp.GameCanvasImplementation
.paintVideo
W/dalvikvm(  417): VFY: unable to resolve check-cast 571 (Ljavax/microedition/me
dia/control/VideoControl;) in Lcom/sun/lwuit/impl/midp/GameCanvasImplementation;

D/dalvikvm(  417): VFY: replacing opcode 0x1f at 0x0001
W/dalvikvm(  417): VFY: unable to resolve exception class 569 (Ljavax/microediti
on/media/MediaException;)
W/dalvikvm(  417): VFY: unable to find exception handler at addr 0x42
W/dalvikvm(  417): VFY:  rejected Lcom/sun/lwuit/impl/midp/GameCanvasImplementat
ion;.paintVideo (Lcom/sun/lwuit/Component;ZLjava/lang/Object;Ljava/lang/Object;L
java/lang/Object;)V
W/dalvikvm(  417): VFY:  rejecting opcode 0x0d at 0x0042
W/dalvikvm(  417): VFY:  rejected Lcom/sun/lwuit/impl/midp/GameCanvasImplementat
ion;.paintVideo (Lcom/sun/lwuit/Component;ZLjava/lang/Object;Ljava/lang/Object;L
java/lang/Object;)V
W/dalvikvm(  417): Verifier rejected class Lcom/sun/lwuit/impl/midp/GameCanvasIm
plementation;
W/dalvikvm(  417): threadid=11: thread exiting with uncaught exception (group=0x
40015560)
E/AndroidRuntime(  417): FATAL EXCEPTION: Thread-12
E/AndroidRuntime(  417): java.lang.VerifyError: com.sun.lwuit.impl.midp.GameCanv
asImplementation
E/AndroidRuntime(  417):        at com.sun.lwuit.impl.ImplementationFactory.crea
teImplementation(ImplementationFactory.java:69)
E/AndroidRuntime(  417):        at com.sun.lwuit.Display.init(Display.java:278)
E/AndroidRuntime(  417):        at MobileColours.Colours.startApp(Colours.java:2
9)
E/AndroidRuntime(  417):        at javax.microedition.midlet.MIDlet$MIDletAccess
or.startApp(MIDlet.java:50)
E/AndroidRuntime(  417):        at org.microemu.android.MicroEmulator$3.run(Micr
oEmulator.java:211)
E/AndroidRuntime(  417):        at java.lang.Thread.run(Thread.java:1019)
I/ActivityManager(   74): Displayed org.microemu.android.MobileColours.Colours/o
rg.microemu.android.MicroEmulator: +1s861ms
W/ActivityManager(   74):   Force finishing activity org.microemu.android.Mobile
Colours.Colours/org.microemu.android.MicroEmulator
I/dalvikvm(   74): Jit: resizing JitTable from 1024 to 2048
D/SntpClient(   74): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
"

Please let me know your inputs on this. On similar log, I had seen a comment that removing the media classes solved the issue.

I am not sure what needs to be done.

Please advise.
Thanks in Advance,
Amit


On Mon, Mar 19, 2012 at 11:27 PM, Bartek Teodorczyk <bar...@gmail.com> wrote:
Hi,

Please, send more details about the error from log console.

BR,
Bartek Teodorczyk

On Sun, Mar 11, 2012 at 6:18 PM, suresh <sures...@gmail.com> wrote:
> Hi,
>
> I have a simple J2ME midlet which reads from a file packaged with
> it...the main midlet has an inner class which is used to populate
> values.
>
> The application works file as j2me on all mobiles...when i convert it
> to .apk using microemulator and deploy it on android mobiles it gives
> error as "application has stopped unexpectedly" ... pls help.
>
> --
> You received this message because you are subscribed to the Google Groups "microemulator-support" group.
> To post to this group, send email to microemula...@googlegroups.com.
> To unsubscribe from this group, send email to microemulator-su...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/microemulator-support?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "microemulator-support" group.
To post to this group, send email to microemula...@googlegroups.com.
To unsubscribe from this group, send email to microemulator-su...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/microemulator-support?hl=en.


Florian Hülsmann

unread,
Mar 23, 2012, 8:34:25 AM3/23/12
to microemula...@googlegroups.com
Try compiling the MIDlet itself without those LWUI classes that use "problematic" API calls not supported by microemu, such as Media Player.

Have a nice day,

Florian

amit gurnani <amitg...@gmail.com> schrieb:

--
Florian Hülsmann
<f...@cbix.de>
http://cbix.de

amit gurnani

unread,
Mar 23, 2012, 8:45:05 AM3/23/12
to microemula...@googlegroups.com
Hi,
In my case, I need to remove GameCanvasImplementation.class from LWUIT jar. I dont think that will work.
And if I don't it references the 
import javax.microedition.media.Player;
import javax.microedition.media.control.VideoControl;

Do I need to remove and recompile the GameCanvasImplementation.

This is pretty urgent for me.

Thanks,
Amit

amit gurnani

unread,
Mar 26, 2012, 5:13:16 AM3/26/12
to microemula...@googlegroups.com

Please could u let me know the exact steps what should be done.

ahmad arab

unread,
Mar 26, 2012, 7:55:57 AM3/26/12
to microemula...@googlegroups.com
it is all bad.
try to write your own android app from base....
347.gif
Reply all
Reply to author
Forward
0 new messages